Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.

Commit 47e51a2

Browse files
authored
[misc] minimize base image (#120)
* [docker] drop sudo Signed-off-by: Jakob Ackermann <[email protected]> * [docker] install qpdf in a single stage Signed-off-by: Jakob Ackermann <[email protected]> * [docker] install texlive and additional tlmgr packages in a single stage Signed-off-by: Jakob Ackermann <[email protected]> * [docker] drop the apt package lists Signed-off-by: Jakob Ackermann <[email protected]> * [docker] pull the package lists only once move the installation of nodejs into the dependencies install section Signed-off-by: Jakob Ackermann <[email protected]> * [docker] delete the default nginx configuration files immediately Signed-off-by: Jakob Ackermann <[email protected]> * [docker] skip the downloading and storage of unused texlive artifacts Signed-off-by: Jakob Ackermann <[email protected]> * [docker] drop the npm download cache Signed-off-by: Jakob Ackermann <[email protected]> * [docker] apply review feedback - install qpdf as ubuntu package - add a comment on the nginx config removal - add back and update a note on changing the texlive mirror
1 parent e422c20 commit 47e51a2

File tree

2 files changed

+46
-35
lines changed

2 files changed

+46
-35
lines changed

Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ ADD ${baseDir}/runit /etc/service
5656

5757
# Configure nginx
5858
# ---------------
59-
RUN rm /etc/nginx/sites-enabled/default
6059
ADD ${baseDir}/nginx/nginx.conf /etc/nginx/nginx.conf
6160
ADD ${baseDir}/nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf
6261

Dockerfile-base

+46-34
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,59 @@ ENV baseDir .
99

1010
# Install dependencies
1111
# --------------------
12-
RUN apt-get update
13-
RUN apt-get install -y sudo
14-
RUN apt-get install -y build-essential wget net-tools unzip time imagemagick optipng strace nginx git python zlib1g-dev libpcre3-dev aspell aspell-en aspell-af aspell-am aspell-ar aspell-ar-large aspell-bg aspell-bn aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-gu aspell-he aspell-hi aspell-hr aspell-hsb aspell-hu aspell-hy aspell-id aspell-is aspell-it aspell-kk aspell-kn aspell-ku aspell-lt aspell-lv aspell-ml aspell-mr aspell-nl aspell-nr aspell-ns aspell-pa aspell-pl aspell-pt aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-ss aspell-st aspell-sv aspell-tl aspell-tn aspell-ts aspell-uk aspell-uz aspell-xh aspell-zu
12+
RUN apt-get update \
13+
&& apt-get install -y \
14+
build-essential wget net-tools unzip time imagemagick optipng strace nginx git python zlib1g-dev libpcre3-dev \
15+
qpdf \
16+
aspell aspell-en aspell-af aspell-am aspell-ar aspell-ar-large aspell-bg aspell-bn aspell-br aspell-ca aspell-cs aspell-cy aspell-da aspell-de aspell-el aspell-eo aspell-es aspell-et aspell-eu-es aspell-fa aspell-fo aspell-fr aspell-ga aspell-gl-minimos aspell-gu aspell-he aspell-hi aspell-hr aspell-hsb aspell-hu aspell-hy aspell-id aspell-is aspell-it aspell-kk aspell-kn aspell-ku aspell-lt aspell-lv aspell-ml aspell-mr aspell-nl aspell-nr aspell-ns aspell-pa aspell-pl aspell-pt aspell-pt-br aspell-ro aspell-ru aspell-sk aspell-sl aspell-ss aspell-st aspell-sv aspell-tl aspell-tn aspell-ts aspell-uk aspell-uz aspell-xh aspell-zu \
17+
\
18+
# install Node.JS 10
19+
&& curl -sSL https://deb.nodesource.com/setup_10.x | bash - \
20+
&& apt-get install -y nodejs \
21+
\
22+
&& rm -rf \
23+
# We are adding a custom nginx config in the main Dockerfile.
24+
/etc/nginx/nginx.conf \
25+
/etc/nginx/sites-enabled/default \
26+
/var/lib/apt/lists/*
1527

16-
17-
# Install qpdf
18-
# ------------
19-
WORKDIR /opt
20-
RUN wget https://s3.amazonaws.com/sharelatex-random-files/qpdf-6.0.0.tar.gz && tar xzf qpdf-6.0.0.tar.gz
21-
WORKDIR /opt/qpdf-6.0.0
22-
RUN ./configure && make && make install && ldconfig
23-
24-
25-
# Install Node
28+
# Install Grunt
2629
# ------------
27-
RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
28-
RUN apt-get install -y nodejs
29-
RUN npm install -g grunt-cli
30+
RUN npm install -g \
31+
grunt-cli \
32+
&& rm -rf /root/.npm
3033

3134
# Install TexLive
3235
# ---------------
33-
RUN wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
34-
mkdir /install-tl-unx && \
35-
tar -xvf install-tl-unx.tar.gz -C /install-tl-unx --strip-components=1
36-
RUN echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile && \
37-
/install-tl-unx/install-tl -profile /install-tl-unx/texlive.profile
38-
3936
# CTAN mirrors occasionally fail, in that case install TexLive against an
4037
# specific server, for example http://ctan.crest.fr
41-
# RUN wget http://ctan.crest.fr/tex-archive/systems/texlive/tlnet/install-tl-unx.tar.gz && \
42-
# mkdir /install-tl-unx && \
43-
# tar -xvf install-tl-unx.tar.gz -C /install-tl-unx --strip-components=1
44-
# RUN echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile && \
45-
# /install-tl-unx/install-tl -profile /install-tl-unx/texlive.profile \
46-
# -repository http://ctan.crest.fr/tex-archive/systems/texlive/tlnet/
47-
48-
RUN rm -r /install-tl-unx; \
49-
rm install-tl-unx.tar.gz
50-
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/texlive/2019/bin/x86_64-linux/
51-
RUN tlmgr install latexmk
52-
RUN tlmgr install texcount
38+
#
39+
# # docker build \
40+
# --build-arg TEXLIVE_MIRROR=http://ctan.crest.fr/tex-archive/systems/texlive/tlnet \
41+
# -f Dockerfile-base -t sharelatex/sharelatex-base .
42+
ARG TEXLIVE_MIRROR=http://mirror.ctan.org/systems/texlive/tlnet
43+
44+
ENV PATH "${PATH}:/usr/local/texlive/2019/bin/x86_64-linux"
45+
46+
RUN mkdir /install-tl-unx \
47+
&& curl -sSL \
48+
${TEXLIVE_MIRROR}/install-tl-unx.tar.gz \
49+
| tar -xzC /install-tl-unx --strip-components=1 \
50+
\
51+
&& echo "tlpdbopt_autobackup 0" >> /install-tl-unx/texlive.profile \
52+
&& echo "tlpdbopt_install_docfiles 0" >> /install-tl-unx/texlive.profile \
53+
&& echo "tlpdbopt_install_srcfiles 0" >> /install-tl-unx/texlive.profile \
54+
&& echo "selected_scheme scheme-basic" >> /install-tl-unx/texlive.profile \
55+
\
56+
&& /install-tl-unx/install-tl \
57+
-profile /install-tl-unx/texlive.profile \
58+
-repository ${TEXLIVE_MIRROR} \
59+
\
60+
&& tlmgr install --repository ${TEXLIVE_MIRROR} \
61+
latexmk \
62+
texcount \
63+
\
64+
&& rm -rf /install-tl-unx
5365

5466

5567
# Set up sharelatex user and home directory

0 commit comments

Comments
 (0)