diff --git a/tools/docker/README.md b/tools/docker/README.md index 70582a2e14..0c45417eb3 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -1,17 +1,27 @@ # Build container -**Clone repo** +**Build docker image** -* `cd ~/` -* `git clone https://github.com/LibreELEC/LibreELEC.tv.git LibreELEC` +Use the following command to create a docker image and tag it with `libreelec`. -**Build container** +``` +docker build --pull -t libreelec tools/docker/focal +``` -* `cd ~/LibreELEC` -* `docker build --pull -t libreelec tools/docker/bionic` +See https://docs.docker.com/engine/reference/commandline/build/ for details on `docker build` usage. -**Build image inside container** +**Build LibreELEC image inside a container** -* `docker run -v ~/:/home/docker -h libreelec -it libreelec` -* `cd ~/LibreELEC` -* `make image` +Use the following command to build LibreELEC images inside a new container based on the docker image tagged with `libreelec`. + +``` +docker run --rm -v `pwd`:/build -w /build -it libreelec make image +``` + +Use `--env`, `-e` or `--env-file` to pass environment variables used by the LibreELEC buildsystem. + +``` +docker run --rm -v `pwd`:/build -w /build -it -e PROJECT=RPi -e DEVICE=RPi4 -e ARCH=arm libreelec make image +``` + +See https://docs.docker.com/engine/reference/commandline/run/ for details on `docker run` usage. diff --git a/tools/docker/bionic/Dockerfile b/tools/docker/bionic/Dockerfile index 9a16f51ea8..0c31451a0f 100644 --- a/tools/docker/bionic/Dockerfile +++ b/tools/docker/bionic/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \ wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils perl gawk gperf zip unzip diffutils lzop make file \ g++ xfonts-utils xsltproc default-jre-headless python3 \ libc6-dev libncurses5-dev \ - libjson-perl libxml-parser-perl \ + libjson-perl libxml-parser-perl libparse-yapp-perl \ golang-go \ git openssh-client \ --no-install-recommends \ diff --git a/tools/docker/buster/Dockerfile b/tools/docker/buster/Dockerfile new file mode 100644 index 0000000000..bc1a2932cb --- /dev/null +++ b/tools/docker/buster/Dockerfile @@ -0,0 +1,31 @@ +FROM debian:buster + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get dist-upgrade -y \ + && apt-get install -y locales sudo \ + && rm -rf /var/lib/apt/lists/* + +RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ + && update-locale LANG=en_US.UTF-8 LANGUAGE=en_US:en +ENV LANG=en_US.UTF-8 \ + LANGUAGE=en_US:en \ + LC_ALL=en_US.UTF-8 + +RUN adduser --disabled-password --gecos '' docker \ + && adduser docker sudo \ + && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +RUN apt-get update && apt-get install -y \ + wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils perl gawk gperf zip unzip diffutils lzop make file \ + g++ xfonts-utils xsltproc default-jre-headless python3 \ + libc6-dev libncurses5-dev \ + libjson-perl libxml-parser-perl libparse-yapp-perl \ + golang-go \ + git openssh-client \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +USER docker diff --git a/tools/docker/eoan/Dockerfile b/tools/docker/eoan/Dockerfile index 2929fcc036..4d5abffe96 100644 --- a/tools/docker/eoan/Dockerfile +++ b/tools/docker/eoan/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \ wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils perl gawk gperf zip unzip diffutils lzop make file \ g++ xfonts-utils xsltproc default-jre-headless python3 \ libc6-dev libncurses5-dev \ - libjson-perl libxml-parser-perl \ + libjson-perl libxml-parser-perl libparse-yapp-perl \ golang-go \ git openssh-client \ --no-install-recommends \ diff --git a/tools/docker/focal/Dockerfile b/tools/docker/focal/Dockerfile new file mode 100644 index 0000000000..b6150078ea --- /dev/null +++ b/tools/docker/focal/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:focal + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get dist-upgrade -y \ + && apt-get install -y locales sudo \ + && rm -rf /var/lib/apt/lists/* + +RUN locale-gen en_US.UTF-8 \ + && update-locale LANG=en_US.UTF-8 LANGUAGE=en_US:en +ENV LANG=en_US.UTF-8 \ + LANGUAGE=en_US:en \ + LC_ALL=en_US.UTF-8 + +RUN adduser --disabled-password --gecos '' docker \ + && adduser docker sudo \ + && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +RUN apt-get update && apt-get install -y \ + wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils perl gawk gperf zip unzip diffutils lzop make file \ + g++ xfonts-utils xsltproc default-jre-headless python3 \ + libc6-dev libncurses5-dev \ + libjson-perl libxml-parser-perl libparse-yapp-perl \ + golang-go \ + git openssh-client \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +USER docker diff --git a/tools/docker/stretch/Dockerfile b/tools/docker/stretch/Dockerfile index ebbab01ac5..74259b33f9 100644 --- a/tools/docker/stretch/Dockerfile +++ b/tools/docker/stretch/Dockerfile @@ -22,7 +22,7 @@ RUN apt-get update && apt-get install -y \ wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils perl gawk gperf zip unzip diffutils lzop make file \ g++ xfonts-utils xsltproc default-jre-headless python3 \ libc6-dev libncurses5-dev \ - libjson-perl libxml-parser-perl \ + libjson-perl libxml-parser-perl libparse-yapp-perl \ golang-go \ git openssh-client \ --no-install-recommends \ diff --git a/tools/docker/xenial/Dockerfile b/tools/docker/xenial/Dockerfile index 574031a7c1..5dcbd002f0 100644 --- a/tools/docker/xenial/Dockerfile +++ b/tools/docker/xenial/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \ wget bash bc gcc sed patch patchutils tar bzip2 gzip xz-utils perl gawk gperf zip unzip diffutils lzop make file \ g++ xfonts-utils xsltproc default-jre-headless python3 \ libc6-dev libncurses5-dev \ - libjson-perl libxml-parser-perl \ + libjson-perl libxml-parser-perl libparse-yapp-perl \ golang-go \ git openssh-client \ --no-install-recommends \