From 1d37fbee4e317b4348f5dedaa0a9000d847d490a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=BCller?= Date: Mon, 29 Aug 2022 11:48:22 +0200 Subject: [PATCH] Build custom base image --- CHANGES.md | 30 +++++++++++++++++------------- Dockerfile | 13 ++++++------- Dockerfile-base | 9 +++++++-- build-base.sh | 6 ++++++ 4 files changed, 36 insertions(+), 22 deletions(-) create mode 100755 build-base.sh diff --git a/CHANGES.md b/CHANGES.md index bd6ee6a147..0357f42f6b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,17 +1,21 @@ # Changes applied to this container -- Install pip and some Python modules in the container by adding the following to `Dockerfile`: - ``` - RUN apt-get update \ - && apt-get install -y python3-pip \ - && python3 -m pip install Flask requests - ``` -- Update TeXLive and install additional packages by adding the following to `Dockerfile`: - ``` - RUN tlmgr option repository ftp://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2021/tlnet-final \ - && tlmgr update --self \ - && tlmgr update --all \ - && tlmgr install xcolor - ``` +- Build custom base image to use the full Texlive distribution by applying the following changes to `Dockerfile-base`: + - Use `TEXLIVE_MIRROR=ftp://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2021/tlnet-final` + - Set `selected_scheme` to `scheme-full` + - Update Texlive: + ``` + RUN tlmgr option repository ftp://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2021/tlnet-final \ + && tlmgr update --self \ + && tlmgr update --all + ``` +- Modifications to the main Docker file `Dockerfile`: + - Use the custom base image + - Install pip and some Python modules: + ``` + RUN apt-get update \ + && apt-get install -y python3-pip \ + && python3 -m pip install Flask requests + ``` - Add `runit/remote-api-server/*` as a testing drone - Make sure that the `run` file has the executable flag set - Modify `bin/grunt` as follows: diff --git a/Dockerfile b/Dockerfile index c0f3201a10..1c789ddf06 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,9 @@ # Overleaf Community Edition (overleaf/overleaf) # --------------------------------------------- -ARG SHARELATEX_BASE_TAG=sharelatex/sharelatex-base:2.7.0 +# ARG SHARELATEX_BASE_TAG=sharelatex/sharelatex-base:2.7.0 +# Use a custom base image which provides the "full" Texlive distribution +ARG SHARELATEX_BASE_TAG=omnivox/overleaf-base:latest FROM $SHARELATEX_BASE_TAG # Install pip and Flask @@ -73,12 +75,9 @@ COPY ${baseDir}/settings.js /etc/sharelatex/settings.js ADD ${baseDir}/bin/grunt /usr/local/bin/grunt RUN chmod +x /usr/local/bin/grunt -# Update TeXLive and install additional packages -# ---------------------------------------------- -RUN tlmgr option repository ftp://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2021/tlnet-final \ -&& tlmgr update --self \ -&& tlmgr update --all \ -&& tlmgr install xcolor +# Add missing TeX packages +# ------------------------ +# tlmgr install # Set Environment Variables # -------------------------------- diff --git a/Dockerfile-base b/Dockerfile-base index 0878d4a8e1..fa4b3d8161 100644 --- a/Dockerfile-base +++ b/Dockerfile-base @@ -43,7 +43,7 @@ RUN chmod +x /usr/bin/envsubst # # docker build \ # --build-arg TEXLIVE_MIRROR=http://ctan.crest.fr/tex-archive/systems/texlive/tlnet \ # -f Dockerfile-base -t sharelatex/sharelatex-base . -ARG TEXLIVE_MIRROR=http://mirror.ctan.org/systems/texlive/tlnet +ARG TEXLIVE_MIRROR=ftp://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2021/tlnet-final ENV PATH "${PATH}:/usr/local/texlive/2021/bin/x86_64-linux" @@ -55,7 +55,7 @@ RUN mkdir /install-tl-unx \ && echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \ && echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \ && echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \ -&& echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \ +&& echo "selected_scheme scheme-full" >> /install-tl-unx/texlive.profile \ \ && /install-tl-unx/install-tl \ -profile /install-tl-unx/texlive.profile \ @@ -67,6 +67,11 @@ RUN mkdir /install-tl-unx \ \ && rm -rf /install-tl-unx +# Update Texlive +# -------------- +RUN tlmgr option repository ftp://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2021/tlnet-final \ +&& tlmgr update --self \ +&& tlmgr update --all # Set up sharelatex user and home directory # ----------------------------------------- diff --git a/build-base.sh b/build-base.sh new file mode 100755 index 0000000000..2bcd3e7248 --- /dev/null +++ b/build-base.sh @@ -0,0 +1,6 @@ +#!/bin/bash +docker build -f Dockerfile-base -t omnivox/overleaf-base:latest . +docker login --username omnivox --password "*FP!4p6z)D4VT4." +docker push omnivox/overleaf-base:latest +docker logout +docker system prune --all --volumes --force