diff --git a/SUMMARY.md b/SUMMARY.md index 5484d75..40b842e 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -55,6 +55,7 @@ ## Development * [Building (Basics)](development-1/build-basics.md) +* [Building (Docker)](development-1/build-docker.md) * [Building (Advanced)](development-1/build-advanced.md) * [Building (Windows WSL)](development-1/building-windows-wsl.md) * [Beginners Guide to Git](development-1/git-tutorial.md) diff --git a/development-1/build-basics.md b/development-1/build-basics.md index 82db02d..2c951dd 100644 --- a/development-1/build-basics.md +++ b/development-1/build-basics.md @@ -4,7 +4,7 @@ The LibreELEC “build-system” is a collection of scripts that simplify the co ## Environment -The team currently builds official releases and snapshots on Ubuntu LTS server 18.04 or 20.04. It is possible to use other Linux distrutions \(Arch, Debian, Fedora, Gentoo, Manjaro, etc.\) but Ubuntu is the most-used and proven. If you plan to build on an existing Linux desktop we recommend building in a Docker container to isolate the build folders from the rest of the OS \(Dockerfiles can be found in the tools folder of the main LibreELEC git repo\). Another option is building in a Virtual Machine, e.g. Oracle Virtualbox \($free\) or vmware Workstation. +The team currently builds official releases and snapshots on Ubuntu LTS server 18.04 or 20.04. It is possible to use other Linux distrutions \(Arch, Debian, Fedora, Gentoo, Manjaro, etc.\) but Ubuntu is the most-used and proven. If you plan to build on an existing Linux desktop we recommend building in a Docker container to isolate the build folders from the rest of the OS \(Dockerfiles can be found in the tools folder of the main LibreELEC git repo, see [Build (Docker)](build-docker.md) for more info\). Another option is building in a Virtual Machine, e.g. Oracle Virtualbox \($free\) or vmware Workstation. Note: If you want to compile older LibreELEC releases you will need to use an era-appropriate Ubuntu LTS release, e.g. LibreELEC 7.0 will need Ubuntu 14.04 or 16.04. diff --git a/development-1/build-docker.md b/development-1/build-docker.md new file mode 100644 index 0000000..73f6a4a --- /dev/null +++ b/development-1/build-docker.md @@ -0,0 +1,50 @@ +# Building \(Docker\) + +## 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)](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 +``` +