From 4d0880c5b8813398b6ab44a2683ae61ece62cfa9 Mon Sep 17 00:00:00 2001 From: Raphael Reitzig <4246780+reitzig@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:14:32 +0100 Subject: [PATCH 1/4] feat: Add override for TeXlive repo ref: issue #18 --- Dockerfile | 1 + README.md | 27 +++++++++++++++++++++++++++ entrypoint.sh | 41 +++++++++++++++++++++++++---------------- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e2fa3a..6bc7376 100644 --- a/Dockerfile +++ b/Dockerfile @@ -97,6 +97,7 @@ 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; \ diff --git a/README.md b/README.md index 8861b19..1a22e08 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,33 @@ Place a file called `Texlivefile` with a list of required CTAN packages, one name per line, in the source directory. The container will install all packages on that list before running the work command. +--- +⚠️ Images will stop working once a new version of TeXlive is released with an error like this: + +> tlmgr: Local TeX Live (2023) is older than remote repository (2024). + +If you need to keep using an older image for a little while, +you can override the repository by setting environment variable +`TEXLIVE_REPOSITORY` to a value like +``` +https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2023/tlnet-final +``` +This feature has available since 2024.1; +see + [reitzig/texlive-docker#18](https://github.com/reitzig/texlive-docker/issues/18) +for hints on how to backport it to older images. + +⚠️ Note that most CTAN mirrors do not maintain historic versions +(cf. [tex.SE#460132](https://tex.stackexchange.com/questions/460132/historic-tex-live-distributions-https-sftp-mirror)), +so keep in mind that widespread use of this workaround _will_ stress those few mirrors who do. +We strongly recommend upgrading to the latest TeXlive version as soon as possible! + + + + +--- + ### Parameters You can adjust some defaults of the diff --git a/entrypoint.sh b/entrypoint.sh index 6176cba..a7b4165 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -34,20 +34,23 @@ Commands: Environment Variables: - OUT_DIR Directory for the relevant output of work commands. - Default: /work/out - SRC_DIR Directory with project sources. Can be read-only. - Default: /work/src - TMP_DIR The working directory for work commands. - Default: /work/tmp - BUILDSCRIPT Script in SRC_DIR that can be run by the work command. - Default: build.sh - TEXLIVEFILE A file in SRC_DIR that contains the TeXlive packages the - project requires, one package name per line. - Default: Texlivefile - OUTPUT Bash glob pattern that defines the relevant output of - work commands. - Default: '*.pdf *.log' + OUT_DIR Directory for the relevant output of work commands. + Default: /work/out + SRC_DIR Directory with project sources. Can be read-only. + Default: /work/src + TMP_DIR The working directory for work commands. + Default: /work/tmp + BUILDSCRIPT Script in SRC_DIR that can be run by the work command. + Default: build.sh + TEXLIVE_REPOSITORY Direct URL to a TeXlive repository; + bypasses use of mirrors.ctan.org and gives access to history versions. + Default: empty (default behaviour of tlmgr) + TEXLIVEFILE A file in SRC_DIR that contains the TeXlive packages the + project requires, one package name per line. + Default: Texlivefile + OUTPUT Bash glob pattern that defines the relevant output of + work commands. + Default: '*.pdf *.log' HELP )" @@ -94,9 +97,15 @@ case "${command}" in if [[ -f "${SRC_DIR}/${TEXLIVEFILE}" ]]; then if ! sha256sum -c "${hashfile}" > /dev/null 2>&1; then + tlrepo="" + if [ -n "${TEXLIVE_REPOSITORY}" ]; then + echo "Will use TeXlive repository ${TEXLIVE_REPOSITORY}" + tlrepo="--repository ${TEXLIVE_REPOSITORY}" + fi + echo "Installing dependencies ..." - tlmgr update --self - xargs tlmgr install < "${SRC_DIR}/${TEXLIVEFILE}" + tlmgr update ${tlrepo} --self + xargs tlmgr install ${tlrepo} < "${SRC_DIR}/${TEXLIVEFILE}" tlmgr path add sha256sum "${SRC_DIR}/${TEXLIVEFILE}" > "${hashfile}" else From a31afb85c362f59d08d04ce6895aee560640b237 Mon Sep 17 00:00:00 2001 From: Raphael <4246780+reitzig@users.noreply.github.com> Date: Thu, 28 Mar 2024 00:53:41 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a22e08..6b23e86 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ you can override the repository by setting environment variable ``` https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2023/tlnet-final ``` -This feature has available since 2024.1; +This feature has been available since 2024.1; see [reitzig/texlive-docker#18](https://github.com/reitzig/texlive-docker/issues/18) for hints on how to backport it to older images. From e7f540701354872e1d5a5ceeeaf82f8520f1509d Mon Sep 17 00:00:00 2001 From: Raphael <4246780+reitzig@users.noreply.github.com> Date: Thu, 28 Mar 2024 00:53:54 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b23e86..978f3d4 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ for hints on how to backport it to older images. ⚠️ Note that most CTAN mirrors do not maintain historic versions (cf. [tex.SE#460132](https://tex.stackexchange.com/questions/460132/historic-tex-live-distributions-https-sftp-mirror)), -so keep in mind that widespread use of this workaround _will_ stress those few mirrors who do. +so keep in mind that widespread use of this workaround _will_ stress those few mirrors that do. We strongly recommend upgrading to the latest TeXlive version as soon as possible! From 24beb6cfe1a0195e641a40453a374b548cc87d24 Mon Sep 17 00:00:00 2001 From: Raphael <4246780+reitzig@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:22:03 +0100 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 978f3d4..bae368d 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2023/tlnet-final ``` This feature has been available since 2024.1; see - [reitzig/texlive-docker#18](https://github.com/reitzig/texlive-docker/issues/18) + [reitzig/texlive-docker#18.2022953222](https://github.com/reitzig/texlive-docker/issues/18#issuecomment-2022953222) for hints on how to backport it to older images. ⚠️ Note that most CTAN mirrors do not maintain historic versions