Skip to content

Commit

Permalink
Build custom base image
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-WWU-IT committed Aug 29, 2022
1 parent d5e36dc commit 1d37fbe
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
30 changes: 17 additions & 13 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <package>

# Set Environment Variables
# --------------------------------
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 \
Expand All @@ -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
# -----------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions build-base.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1d37fbe

Please sign in to comment.