1
- FROM alpine:3.20.3
1
+ FROM alpine:3.20.3 AS build
2
2
3
3
# installation settings
4
4
ARG TL_MIRROR="https://texlive.info/CTAN/systems/texlive/tlnet"
5
5
6
- RUN apk add --no-cache perl curl fontconfig libgcc gnupg && \
6
+ RUN apk add --no-cache perl curl fontconfig libgcc gnupg xz && \
7
7
mkdir "/tmp/texlive" && cd "/tmp/texlive" && \
8
8
wget "$TL_MIRROR/install-tl-unx.tar.gz" && \
9
9
tar xzvf ./install-tl-unx.tar.gz && \
@@ -18,12 +18,31 @@ RUN apk add --no-cache perl curl fontconfig libgcc gnupg && \
18
18
echo "TEXMFSYSVAR /opt/texlive/texmf-var" && \
19
19
echo "TEXMFHOME ~/.texmf" \
20
20
) > "/tmp/texlive.profile" && \
21
- "./install-tl-" *"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" && \
22
- rm -vf "/opt/texlive/install-tl" && \
23
- rm -vf "/opt/texlive/install-tl.log" && \
24
- rm -vrf /tmp/*
21
+ set -eux; cd "/tmp/texlive" && arch=$(uname -m); \
22
+ case $arch in \
23
+ x86_64) ARCHITECTURE='amd64' ;; \
24
+ aarch64) ARCHITECTURE='arm64' ;; \
25
+ *) echo >&2 "error: unsupported architecture ($arch)" ; exit 1 ;;\
26
+ esac; \
27
+ echo "Architecture: $ARCHITECTURE" ; \
28
+ if [ "$ARCHITECTURE" = "amd64" ]; then \
29
+ "./install-tl-" *"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" && \
30
+ ln -s /opt/texlive/bin/x86_64-linuxmusl /opt/texlive/bin/current; \
31
+ fi; \
32
+ if [ "$ARCHITECTURE" = "arm64" ]; then \
33
+ wget https://ftp.math.utah.edu/pub/texlive-utah/bin/aarch64-alpine319.tar.xz && \
34
+ tar xvf aarch64-alpine319.tar.xz && \
35
+ "./install-tl-" *"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" --custom-bin=/tmp/texlive/aarch64-alpine319 && \
36
+ ln -s /opt/texlive/bin/custom /opt/texlive/bin/current; \
37
+ fi;
25
38
26
- ENV PATH="${PATH}:/opt/texlive/bin/x86_64-linuxmusl"
39
+ FROM alpine:3.20.3 AS final
40
+
41
+ RUN apk add --no-cache perl curl
42
+
43
+ COPY --from=build /opt/texlive /opt/texlive
44
+
45
+ ENV PATH="${PATH}:/opt/texlive/bin/current"
27
46
28
47
ARG TL_SCHEME_BASIC="y"
29
48
RUN if [ "$TL_SCHEME_BASIC" = "y" ]; then tlmgr install scheme-basic; fi
0 commit comments