Skip to content

Commit b0d97f5

Browse files
authored
put apt calls together to streamline the dockerfile (#253)
1 parent 6e08b8c commit b0d97f5

File tree

1 file changed

+29
-33
lines changed

1 file changed

+29
-33
lines changed

Dockerfile

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,23 @@ FROM ${RUNBASE} AS run
9090

9191
ARG TARGETPLATFORM
9292

93-
# Copy Typst
94-
COPY --from=build-typst /usr/local/cargo/bin/typst /usr/local/bin
95-
96-
# These binaries are the second most costly part of the build.
97-
COPY --from=build-texlive /texlivebins /usr/local/texlive
98-
99-
# Copy only the fonts we're using from the template.
100-
COPY --from=build-fonts \
101-
/usr/share/fonts/truetype/msttcorefonts/Arial* \
102-
/usr/share/fonts/truetype/msttcorefonts/Courier* \
103-
/usr/share/fonts/TTF/ARIAL* \
104-
/usr/share/fonts/OTF/Libertinus* \
105-
/usr/share/fonts/truetype/noto/NotoSansMono* \
106-
/usr/share/fonts/
107-
108-
RUN apt update && apt install -y fontconfig && \
109-
fc-cache -f
110-
111-
RUN apt install -y \
93+
RUN apt update && apt install -y \
94+
aasvg \
95+
xorg \
96+
xvfb \
97+
dbus \
11298
bash \
11399
default-jre \
100+
fontconfig \
101+
imagemagick \
102+
libnss3 \
103+
librsvg2-bin \
104+
libsecret-1-0 \
105+
libxss1 \
114106
moreutils \
115107
nodejs \
116108
npm \
109+
openbox \
117110
rsync \
118111
sed \
119112
software-properties-common \
@@ -137,6 +130,10 @@ RUN wget -O /usr/share/plantuml.jar https://github.com/plantuml/plantuml/release
137130
# built above, not any that happen to have come along with our base image.
138131
ENV PATH="/usr/local/texlive/bin/aarch64-linux:/usr/local/texlive/bin/x86_64-linux:${PATH}"
139132

133+
# Copy TeX Live and latexdiff
134+
COPY --from=build-texlive /texlivebins /usr/local/texlive
135+
COPY --from=build-latexdiff /usr/local/bin/latexdiff* /usr/local/bin
136+
140137
# Packages that are needed despite not being used explicitly by the template:
141138
# bigfoot, catchfile, fancyvrb, footmisc, framed, hardwrap, lineno, ltablex, latexmk, needspace, pgf, zref
142139
# Package dependencies introduced by latexdiff:
@@ -211,18 +208,6 @@ RUN tlmgr update --self && tlmgr install \
211208
xltabular \
212209
zref
213210

214-
RUN apt install -y \
215-
aasvg \
216-
dbus \
217-
imagemagick \
218-
libnss3 \
219-
librsvg2-bin \
220-
libsecret-1-0 \
221-
libxss1 \
222-
openbox \
223-
xorg \
224-
xvfb
225-
226211
ENV DRAWIO_RELEASE=26.0.16
227212

228213
# TARGETPLATFORM is linux/arm64 or linux/amd64. The release for amd64 is called drawio-amd64-23.1.5.deb.
@@ -231,8 +216,19 @@ RUN export DRAWIO_DEB=drawio-${TARGETPLATFORM#linux/}-${DRAWIO_RELEASE}.deb && \
231216
dpkg -i ${DRAWIO_DEB} && \
232217
rm ${DRAWIO_DEB}
233218

234-
# Grab latexdiff
235-
COPY --from=build-latexdiff /usr/local/bin/latexdiff* /usr/local/bin
219+
# Copy Typst
220+
COPY --from=build-typst /usr/local/cargo/bin/typst /usr/local/bin
221+
222+
# Copy only the fonts we're using from the template.
223+
COPY --from=build-fonts \
224+
/usr/share/fonts/truetype/msttcorefonts/Arial* \
225+
/usr/share/fonts/truetype/msttcorefonts/Courier* \
226+
/usr/share/fonts/TTF/ARIAL* \
227+
/usr/share/fonts/OTF/Libertinus* \
228+
/usr/share/fonts/truetype/noto/NotoSansMono* \
229+
/usr/share/fonts/
230+
# Refresh the font cache.
231+
RUN fc-cache -f
236232

237233
# https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion
238234
RUN sed -i '/disable ghostscript format types/,+6d' /etc/ImageMagick-6/policy.xml

0 commit comments

Comments
 (0)