> For the complete documentation index, see [llms.txt](https://wiki.libreelec.tv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.libreelec.tv/development/build-docker.md).

# Building (Docker)

Docker is used to build official releases, and nightly images in Ubuntu LTS 22.04 Docker containers at the teams https\://github.com/LibreELEC/actions CI/CD.

## Useful links

The following links will help you get started with using docker to build LibreELEC.

* <https://github.com/LibreELEC/LibreELEC.tv/tree/master/tools/docker>
* <https://github.com/LibreELEC/actions>

## Build Container

```bash
# apply patches to make the image like in CI
sed -i -e "/^USER docker/i RUN ln -s /usr/bin/gcc-10 /usr/bin/cc" tools/docker/focal/Dockerfile

# per tools/docker/README.md
docker build --pull -t libreelec tools/docker/focal
```

## Run Commands

For a list of commands, see [Build (Basics)](/development/build-basics.md).

### Basic

```bash
docker run \
  -it --rm \
  --log-driver none \
  -v `pwd`:/build -w /build \
  -e PROJECT=Generic \
  -e ARCH=x86_64 \
  -e MTPROGRESS=yes \
  libreelec CMD
```

### Advanced

Limit CPU and RAM so your system remains responsive.

```bash
docker run \
  -it --rm \
  --log-driver none \
  -v `pwd`:/build -w /build \
  `# setting these the same disables swapping` \
  --memory "6g" --memory-swap "6g" \
  `# uses all cpus, but will reserve cycles on each` \
  `#--cpus "4"` \
  `# limit to certain processors` \
  --cpuset-cpus "0-3" \
  -e PROJECT=Generic \
  -e ARCH=x86_64 \
  -e MTPROGRESS=yes \
  libreelec CMD
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wiki.libreelec.tv/development/build-docker.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
