-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
139 lines (123 loc) · 5.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
FROM alpine:3.20@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d AS texlive-installer
# renovate: datasource=repology depName=alpine_3_20/bash versioning=loose
ENV BASH_VERSION="5.2.26-r0"
# renovate: datasource=repology depName=alpine_3_20/cairo versioning=loose
ENV CAIRO_VERSION="1.18.0-r0"
# renovate: datasource=repology depName=alpine_3_20/gpg versioning=loose
ENV GPG_VERSION="2.4.5-r0"
# renovate: datasource=repology depName=alpine_3_20/icu versioning=loose
ENV ICU_LIBS_VERSION="74.2-r0"
# renovate: datasource=repology depName=alpine_3_20/gcc versioning=loose
ENV LIBGCC_VERSION="13.2.1_git20240309-r0"
# renovate: datasource=repology depName=alpine_3_20/libpaper versioning=loose
ENV LIBPAPER_VERSION="2.2.5-r0"
# renovate: datasource=repology depName=alpine_3_20/libpng versioning=loose
ENV LIBPNG_VERSION="1.6.44-r0"
# renovate: datasource=repology depName=alpine_3_20/gcc versioning=loose
ENV LIBSTDCPP_VERSION="13.2.1_git20240309-r0"
# renovate: datasource=repology depName=alpine_3_20/libx11 versioning=loose
ENV LIBX11_VERSION="1.8.9-r1"
# renovate: datasource=repology depName=alpine_3_20/musl versioning=loose
ENV MUSL_VERSION="1.2.5-r0"
# renovate: datasource=repology depName=alpine_3_20/perl versioning=loose
ENV PERL_VERSION="5.38.2-r0"
# renovate: datasource=repology depName=alpine_3_20/pixman versioning=loose
ENV PIXMAN_VERSION="0.43.2-r0"
# renovate: datasource=repology depName=alpine_3_20/wget versioning=loose
ENV WGET_VERSION="1.24.5-r0"
# renovate: datasource=repology depName=alpine_3_20/xz versioning=loose
ENV XZ_VERSION="5.6.2-r0"
# renovate: datasource=repology depName=alpine_3_20/zlib versioning=loose
ENV ZLIB_VERSION="1.3.1-r1"
RUN apk --no-cache add \
bash=${BASH_VERSION} \
cairo=${CAIRO_VERSION} \
gpg=${GPG_VERSION} \
icu-libs=${ICU_LIBS_VERSION} \
libgcc=${LIBGCC_VERSION} \
libpaper=${LIBPAPER_VERSION} \
libpng=${LIBPNG_VERSION} \
libstdc++=${LIBSTDCPP_VERSION} \
libx11=${LIBX11_VERSION} \
musl=${MUSL_VERSION} \
perl=${PERL_VERSION} \
pixman=${PIXMAN_VERSION} \
wget=${WGET_VERSION} \
xz=${XZ_VERSION} \
zlib=${ZLIB_VERSION}
ARG ctan_mirror="https://mirrors.ctan.org"
ENV CTAN_MIRROR=$ctan_mirror
RUN wget "${CTAN_MIRROR}/systems/texlive/tlnet/install-tl-unx.tar.gz" \
&& tar -xzf install-tl-unx.tar.gz \
&& rm install-tl-unx.tar.gz \
&& mv install-tl-* install-tl
ENTRYPOINT cat install-tl/release-texlive.txt
# Only used in `make-release-tag.sh`, overwritten for final image below
# # # # # # # # # # # # # # #
# Re-use the installer image -- built only once during CI/CD!
# cf. build-image.sh
FROM texlive-installer AS texlive
ARG profile=minimal
COPY "profiles/${profile}.profile" /install-tl/${profile}.profile
# Workaround: installer doesn't seem to handle linuxmusl(-only) install correctly
RUN tlversion=$(cat install-tl/release-texlive.txt | head -n 1 | awk '{ print $5 }') \
&& mkdir -p /usr/local/texlive/${tlversion}/bin \
&& ln -s /usr/local/texlive/${tlversion}/bin/x86_64-linuxmusl /usr/local/texlive/${tlversion}/bin/x86_64-linux \
&& ln -s /usr/local/texlive/${tlversion}/bin/x86_64-linuxmusl/mktexlsr /usr/local/bin/mktexlsr
ARG ctan_mirror="https://mirrors.ctan.org"
ENV CTAN_MIRROR=$ctan_mirror
RUN ( cd install-tl \
&& tlversion=$(cat release-texlive.txt | head -n 1 | awk '{ print $5 }') \
&& sed -i "s/\${tlversion}/${tlversion}/g" ${profile}.profile \
&& ./install-tl -repository="${CTAN_MIRROR}/systems/texlive/tlnet" -profile ${profile}.profile \
) \
&& rm -rf install-tl \
&& tlmgr version | tail -n 1 > version \
&& echo "Installed on $(date)" >> version
# && tlmgr option repository "${CTAN_MIRROR}"
# TODO: Determine if this is necessary -- shouldn't be, and
# we don't want to hammer the same mirror whenever the image is used!
ARG src_dir="/work/src"
ARG tmp_dir="/work/tmp"
ARG out_dir="/work/out"
ENV SRC_DIR="${src_dir}"
ENV TMP_DIR="${tmp_dir}"
ENV OUT_DIR="${out_dir}"
# Instead of VOLUME, which breaks multi-stage builds:
RUN mkdir -p "${src_dir}" "${tmp_dir}" "${out_dir}"
ENV TEXLIVE_REPOSITORY=""
COPY entrypoint.sh /bin/entrypoint
# Add "aliases" to align `docker run` and `docker exec` usage.
RUN set -eo noclobber; \
for cmd in help version hold clean work; do \
echo -e "#!/bin/sh\n\nentrypoint ${cmd} \"\${@}\"" > /bin/${cmd}; \
chmod +x /bin/${cmd}; \
done
WORKDIR /work
ENV BUILDSCRIPT="build.sh"
ENV TEXLIVEFILE="Texlivefile"
ENV OUTPUT="*.pdf *.log"
# Labels as per OCI annotation spec
# cf. https://github.com/opencontainers/image-spec/blob/master/annotations.md (Oct 2019)
ARG label_maintainer="Raphael Reitzig"
ARG label_github="https://github.com/reitzig/texlive-docker"
ARG label_created="nA"
ARG label_version="nA"
ARG label_tlversion=""
ARG label_revision="nA"
LABEL org.opencontainers.image.created="${label_created}" \
org.opencontainers.image.authors="${label_maintainer}" \
org.opencontainers.image.url="${label_github}" \
org.opencontainers.image.documentation="${label_github}" \
org.opencontainers.image.source="${label_github}" \
org.opencontainers.image.version="${label_version}" \
org.opencontainers.image.revision="${label_revision}" \
org.opencontainers.image.vendor="${label_maintainer}" \
org.opencontainers.image.licenses="Apache-2.0" \
# org.opencontainers.image.ref.name -- doesn't apply
org.opencontainers.image.title="TeXlive ${label_tlversion} (${profile})"
# org.opencontainers.image.description -- not much more to tell
# TODO: ONBUILD to install additional packages?
STOPSIGNAL SIGKILL
ENTRYPOINT [ "/bin/entrypoint" ]
CMD [ "help" ]