Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM64 Compatibility for Docker Image #16

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.20.3
FROM alpine:3.20.3 AS build

# installation settings
ARG TL_MIRROR="https://texlive.info/CTAN/systems/texlive/tlnet"

RUN apk add --no-cache perl curl fontconfig libgcc gnupg && \
RUN apk add --no-cache perl curl fontconfig libgcc gnupg xz && \
mkdir "/tmp/texlive" && cd "/tmp/texlive" && \
wget "$TL_MIRROR/install-tl-unx.tar.gz" && \
tar xzvf ./install-tl-unx.tar.gz && \
@@ -18,12 +18,31 @@ RUN apk add --no-cache perl curl fontconfig libgcc gnupg && \
echo "TEXMFSYSVAR /opt/texlive/texmf-var" && \
echo "TEXMFHOME ~/.texmf" \
) > "/tmp/texlive.profile" && \
"./install-tl-"*"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" && \
rm -vf "/opt/texlive/install-tl" && \
rm -vf "/opt/texlive/install-tl.log" && \
rm -vrf /tmp/*
set -eux; cd "/tmp/texlive" && arch=$(uname -m); \
case $arch in \
x86_64) ARCHITECTURE='amd64' ;; \
aarch64) ARCHITECTURE='arm64' ;; \
*) echo >&2 "error: unsupported architecture ($arch)"; exit 1 ;;\
esac; \
echo "Architecture: $ARCHITECTURE"; \
if [ "$ARCHITECTURE" = "amd64" ]; then \
"./install-tl-"*"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" && \
ln -s /opt/texlive/bin/x86_64-linuxmusl /opt/texlive/bin/current; \
fi; \
if [ "$ARCHITECTURE" = "arm64" ]; then \
wget https://ftp.math.utah.edu/pub/texlive-utah/bin/aarch64-alpine319.tar.xz && \
tar xvf aarch64-alpine319.tar.xz && \
"./install-tl-"*"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" --custom-bin=/tmp/texlive/aarch64-alpine319 && \
ln -s /opt/texlive/bin/custom /opt/texlive/bin/current; \
fi;

ENV PATH="${PATH}:/opt/texlive/bin/x86_64-linuxmusl"
FROM alpine:3.20.3 AS final

RUN apk add --no-cache perl fontconfig curl gnupg xz

COPY --from=build /opt/texlive /opt/texlive

ENV PATH="${PATH}:/opt/texlive/bin/current"

ARG TL_SCHEME_BASIC="y"
RUN if [ "$TL_SCHEME_BASIC" = "y" ]; then tlmgr install scheme-basic; fi