Support TeX Live pretest
Yesterday, TeX Live 2024 pretest has started. To test the Markdown package for TeX against the pretest, I set up the building of a pretest TeX Live image witiko/texlive-pretest
, which I will publish daily at Docker Hub until the release of TeX Live in early March. Here is a demo of the image:
vnovotny@hypnos1:~$ docker run --rm -i witiko/texlive-pretest luatex
This is LuaTeX, Version 1.18.0 (TeX Live 2024)
restricted system commands enabled.
** \bye
warning (pdf backend): no pages of output.
Transcript written on texput.log.
In the future, we may want to add support for pretest images to the upstream, as discussed on the IoT Docker Matrix.org chat.
To build the pretest TeX Live image, I use the following shell script named build-pretest-image.sh
:
#!/bin/bash
# Builds the TeX Live 2024 pretest image.
set -e -o xtrace
# Load command-line arguments
if [[ $# != 1 ]]; then
printf 'Usage: %s DOCKER_HUB_USERNAME\n' "$0" >&2
exit 1
fi
# Set variables.
IMAGE_NAME=witiko/texlive-pretest
IMAGE_TAG=`date -Idate`
PRETEST_MIRROR_URL=ftp.cstug.cz::pub/tex/local/tlpretest/
GIT_REPOSITORY=https://gitlab.com/islandoftex/images/texlive.git
CACHE_DIR=build-pretest-image-cache
DOCKER_HUB_USERNAME="$1"
DOCKER_HUB_PASSWORD="$(cat)"
# Set up cache directory.
rm -rf "$CACHE_DIR"
trap 'rm -rf "$CACHE_DIR"' EXIT
mkdir "$CACHE_DIR"
# Build Docker image.
git clone "$GIT_REPOSITORY" "$CACHE_DIR"/git
export DOCKER_BUILDKIT=1
docker build --build-arg TLMIRRORURL="$PRETEST_MIRROR_URL" -t "$IMAGE_NAME":latest -t "$IMAGE_NAME":"$IMAGE_TAG" "$CACHE_DIR"/git
# Push Docker image.
docker login --username "$DOCKER_HUB_USERNAME" --password-stdin <<< "$DOCKER_HUB_PASSWORD"
docker push "$IMAGE_NAME":latest
docker push "$IMAGE_NAME":"$IMAGE_TAG"
# Untag Docker image.
docker rmi "$IMAGE_NAME":"$IMAGE_TAG"
I run the script from crontab
daily as follows:
@daily echo password | ./build-pretest-image.sh witiko
For simplicity and speed, I skip the multi-architecture build and I build the images only for the linux/amd64
architecture straight from the Dockerfile. If we wanted to adapt the script for the upstream, we can likely reuse the script build-latest-image.sh
for building the latest TeX Live image with the following exceptions: Unlike with the latest image, we need to use one of the pretest rsync mirrors. Furthermore, we would also need to use a different tagging scheme; for the Markdown image derived from the witiko/pretest
Docker image, I used the tag witiko/markdown:latest-pretest
.