From 8d66cfb75b2781e74f1de29d8e331f349aef03a8 Mon Sep 17 00:00:00 2001 From: Patrick Elsen Date: Sun, 14 Oct 2018 20:44:23 +0200 Subject: [PATCH 1/9] Removes superfluous packages. The apt package texlive-full already includes texlive-latex-base and texlive-fonts-extra, so they don't have to installed separately. --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef72df0f..7a8a8a28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,7 @@ RUN apt-get install -qqy ffmpeg ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN apt-get install -qqy apt-transport-https -RUN apt-get install -qqy texlive-latex-base RUN apt-get install -qqy texlive-full -RUN apt-get install -qqy texlive-fonts-extra RUN apt-get install -qqy sox RUN apt-get install -qqy git From 4ba9f6b5a31188c53cf51da618de351863a43348 Mon Sep 17 00:00:00 2001 From: Patrick Elsen Date: Sun, 14 Oct 2018 23:32:46 +0200 Subject: [PATCH 2/9] Consolidates apt package installations. Turns all package installations into one single command. --- Dockerfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a8a8a28..105f2146 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,35 +1,33 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND noninteractive +# Install required packages. RUN apt-get update -qqy RUN apt-get install -qqy --no-install-recommends apt-utils - -WORKDIR /root RUN apt-get install -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \ libgdbm-compat-dev liblzma-dev libreadline-dev \ - libncursesw5-dev libffi-dev uuid-dev + libncursesw5-dev libffi-dev uuid-dev \ + libcairo2-dev libjpeg-dev libgif-dev ffmpeg \ + apt-transport-https texlive-full sox git + +# Install Python 3.7. +WORKDIR /root RUN apt-get install -qqy wget RUN wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz RUN tar -xf Python-3.7.0.tgz WORKDIR Python-3.7.0 RUN ./configure > /dev/null && make -s && make -s install RUN python3 -m pip install --upgrade pip -RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev COPY requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt RUN rm requirements.txt WORKDIR /root RUN rm -rf Python-3.7.0* -RUN apt-get install -qqy ffmpeg - +# Setup timezone. ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -RUN apt-get install -qqy apt-transport-https -RUN apt-get install -qqy texlive-full -RUN apt-get install -qqy sox -RUN apt-get install -qqy git ENV DEBIAN_FRONTEND teletype ENTRYPOINT ["/bin/bash"] From 9077860f97eeb6c3a66674a71bcb8c156ff9d5df Mon Sep 17 00:00:00 2001 From: Patrick Elsen Date: Sun, 14 Oct 2018 23:34:06 +0200 Subject: [PATCH 3/9] Removes superfluous delete command. As suggested by @eulertour, this removes the line to delete `requirements.txt` in the python folder, as the whole folder would be deleted later anyways. --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 105f2146..e96eab26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,6 @@ RUN ./configure > /dev/null && make -s && make -s install RUN python3 -m pip install --upgrade pip COPY requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt -RUN rm requirements.txt WORKDIR /root RUN rm -rf Python-3.7.0* From 9b76c29fc7bebe83e2e6d93c088f543047bca37e Mon Sep 17 00:00:00 2001 From: Patrick Elsen Date: Mon, 15 Oct 2018 00:48:08 +0200 Subject: [PATCH 4/9] Revert "Consolidates apt package installations." This reverts commit 4ba9f6b5a31188c53cf51da618de351863a43348. --- Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index e96eab26..4773610f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,34 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND noninteractive -# Install required packages. RUN apt-get update -qqy RUN apt-get install -qqy --no-install-recommends apt-utils + +WORKDIR /root RUN apt-get install -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \ libgdbm-compat-dev liblzma-dev libreadline-dev \ - libncursesw5-dev libffi-dev uuid-dev \ - libcairo2-dev libjpeg-dev libgif-dev ffmpeg \ - apt-transport-https texlive-full sox git - -# Install Python 3.7. -WORKDIR /root + libncursesw5-dev libffi-dev uuid-dev RUN apt-get install -qqy wget RUN wget -q https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz RUN tar -xf Python-3.7.0.tgz WORKDIR Python-3.7.0 RUN ./configure > /dev/null && make -s && make -s install RUN python3 -m pip install --upgrade pip +RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev COPY requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt WORKDIR /root RUN rm -rf Python-3.7.0* -# Setup timezone. +RUN apt-get install -qqy ffmpeg + ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN apt-get install -qqy apt-transport-https +RUN apt-get install -qqy texlive-full +RUN apt-get install -qqy sox +RUN apt-get install -qqy git ENV DEBIAN_FRONTEND teletype ENTRYPOINT ["/bin/bash"] From 08926ad2aa7c651174a135e148199d6a215a9f40 Mon Sep 17 00:00:00 2001 From: Patrick Elsen Date: Mon, 15 Oct 2018 00:50:47 +0200 Subject: [PATCH 5/9] Rearranges Dockerfile. Does timezone setup at the beginning. Separates python installation and requirements installation. --- Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4773610f..1b5b30bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,11 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -qqy RUN apt-get install -qqy --no-install-recommends apt-utils +# Setup timezone. +ENV TZ=America/Los_Angeles +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Install Python 3.7. WORKDIR /root RUN apt-get install -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ libbz2-dev zlib1g-dev libssl-dev openssl libgdbm-dev \ @@ -15,16 +20,15 @@ RUN tar -xf Python-3.7.0.tgz WORKDIR Python-3.7.0 RUN ./configure > /dev/null && make -s && make -s install RUN python3 -m pip install --upgrade pip -RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev -COPY requirements.txt requirements.txt -RUN python3 -m pip install -r requirements.txt WORKDIR /root RUN rm -rf Python-3.7.0* -RUN apt-get install -qqy ffmpeg +# Install requirements. +RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev +COPY requirements.txt requirements.txt +RUN python3 -m pip install -r requirements.txt -ENV TZ=America/Los_Angeles -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN apt-get install -qqy ffmpeg RUN apt-get install -qqy apt-transport-https RUN apt-get install -qqy texlive-full RUN apt-get install -qqy sox From da81ed40155f162f5ea16ad1e4bcbf2eb59d805e Mon Sep 17 00:00:00 2001 From: Patrick Elsen Date: Mon, 15 Oct 2018 02:52:40 +0200 Subject: [PATCH 6/9] Fixes Dockerfile to delete requirements.txt. Moved timezone initialization to texlife and made sure to delete requirements.txt in Dockerfile. --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b5b30bc..26ea1b0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,6 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -qqy RUN apt-get install -qqy --no-install-recommends apt-utils -# Setup timezone. -ENV TZ=America/Los_Angeles -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - # Install Python 3.7. WORKDIR /root RUN apt-get install -qqy build-essential libsqlite3-dev sqlite3 bzip2 \ @@ -27,8 +23,13 @@ RUN rm -rf Python-3.7.0* RUN apt-get install -qqy libcairo2-dev libjpeg-dev libgif-dev COPY requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt - +RUN rm requirements.txt RUN apt-get install -qqy ffmpeg + +# Setup timezone, necessary for textlive. +ENV TZ=America/Los_Angeles +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + RUN apt-get install -qqy apt-transport-https RUN apt-get install -qqy texlive-full RUN apt-get install -qqy sox From 01e42fb3259066c9558f564e50bafd9e03098e5e Mon Sep 17 00:00:00 2001 From: Devin Neal Date: Tue, 2 Apr 2019 00:49:59 +0000 Subject: [PATCH 7/9] remove network restriction --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index a61ed219..f4ef6015 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,3 @@ services: - ${MANIM_PATH:?MANIM_PATH environment variable isn't set}:/opt/manim environment: - PYTHONPATH=/opt/manim - network_mode: "none" From f348df5dbc6b2c51a5f46cf32ee9356a073d4fac Mon Sep 17 00:00:00 2001 From: Devin Neal Date: Tue, 2 Apr 2019 00:55:05 +0000 Subject: [PATCH 8/9] move workdir from dockerfile to docker-compose.yml --- Dockerfile | 1 - docker-compose.yml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2a8c343d..d3af2279 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,5 +11,4 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt && rm requirements.txt -WORKDIR /opt/manim ENTRYPOINT ["python", "-m", "manim"] diff --git a/docker-compose.yml b/docker-compose.yml index f4ef6015..941b4edc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,3 +8,4 @@ services: - ${MANIM_PATH:?MANIM_PATH environment variable isn't set}:/opt/manim environment: - PYTHONPATH=/opt/manim + working_dir: /opt/manim From c114e461d5b154674964e215ad28219fa107d75a Mon Sep 17 00:00:00 2001 From: Devin Neal Date: Tue, 2 Apr 2019 01:04:10 +0000 Subject: [PATCH 9/9] python3 -> python --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d3af2279..3bfcdae2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,5 +10,5 @@ RUN apt-get update \ libcairo2-dev \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt requirements.txt -RUN python3 -m pip install -r requirements.txt && rm requirements.txt +RUN python -m pip install -r requirements.txt && rm requirements.txt ENTRYPOINT ["python", "-m", "manim"]