diff --git a/latex/build-all.sh b/latex/build-all.sh new file mode 100755 index 0000000..ce9ca8b --- /dev/null +++ b/latex/build-all.sh @@ -0,0 +1,9 @@ +cp ./entrypoint.sh default +cd default +./build-image.sh git.janishutz.com/registry/latex-build +cd .. +mv ./default/entrypoint.sh ./full/ +cd full +./build-image.sh git.janishutz.com/registry/latex-build-full +cd .. +rm ./full/entrypoint.sh diff --git a/latex/Dockerfile b/latex/default/Dockerfile similarity index 69% rename from latex/Dockerfile rename to latex/default/Dockerfile index 2890f02..8ce3d31 100644 --- a/latex/Dockerfile +++ b/latex/default/Dockerfile @@ -2,7 +2,7 @@ FROM alpine WORKDIR /root -RUN apk add texlive texlive-bibtexextra texlive-context texlive-dvi texlive-fontutils texmf-dist-langgerman texlive-latexextra texlive-latexrecommended texlive-mathscience texlive-pictures texlive-plaingeneric texlive-pstricks texmf-dist-fontsrecommended +RUN apk add texlive texlive-bibtexextra texlive-context texlive-dvi texlive-fontutils texmf-dist-langgerman texlive-latexextra texlive-latexrecommended texlive-mathscience texlive-pictures texlive-plaingeneric texlive-pstricks texmf-dist-fontsrecommended texmf-dist-fontsextra -COPY entrypoint.sh /root/ +COPY ./entrypoint.sh /root/ RUN chmod +x /root/entrypoint.sh diff --git a/latex/build-image.sh b/latex/default/build-image.sh similarity index 100% rename from latex/build-image.sh rename to latex/default/build-image.sh diff --git a/latex/full/Dockerfile b/latex/full/Dockerfile new file mode 100644 index 0000000..ea1bb94 --- /dev/null +++ b/latex/full/Dockerfile @@ -0,0 +1,10 @@ +FROM git.janishutz.com/registry/latex-build + +WORKDIR /root + +RUN apk add py3-pip python3 + +RUN pip3 install latexminted --break-system-packages + +COPY ./entrypoint.sh /root/ +RUN chmod +x /root/entrypoint.sh diff --git a/latex/full/build-image.sh b/latex/full/build-image.sh new file mode 100755 index 0000000..12228ff --- /dev/null +++ b/latex/full/build-image.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +set -e + +echo "Build will be tagged with $1" +echo "Build directory is $(pwd)" + +OLD_IMG=$(docker image ls -q "$1") +docker buildx build . -t "$1" + +echo "Build complete, starting upload..." +docker push "$1" + +if [ -n "$OLD_IMG" ]; then + if [ "$OLD_IMG" != "$(docker image ls -q "$1")" ]; then + echo "New build uploaded, removing old image, id: $OLD_IMG" + docker image rmi -f "$OLD_IMG" || true + echo "Exit status: $?" + fi +fi