From 6a8aa63b375ac733827d210100a09021156cf95d Mon Sep 17 00:00:00 2001 From: japm48 Date: Sun, 4 Jun 2023 01:07:37 +0200 Subject: [PATCH] use docker as first attempt at reproducibility --- .gitignore | 7 +++++++ Dockerfile | 12 ++++++++++++ _docker_run.sh | 23 +++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 _docker_run.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cda7f7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ + +.texlive*/ +_minted-main/ +main* +~main.tex +*.fls + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..73cca19 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +######## +# DOCKER_BUILDKIT=1 docker build -t my-texlive-23 . +# docker run -v .:/work --env GU_IDS="$(id -u):$(id -g)" -it my-texlive-23 +######## + + +FROM texlive/texlive:TL2022-historic +# FROM registry.gitlab.com/islandoftex/images/texlive:TL2022-historic + +WORKDIR /work +CMD bash /work/_docker_run.sh + diff --git a/_docker_run.sh b/_docker_run.sh new file mode 100644 index 0000000..0e0f3c0 --- /dev/null +++ b/_docker_run.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env dont-run-me-directly bash + +set -e + +if [[ $UID -eq 0 && ! -z "$GU_IDS" ]] +then + # Self-contained bootstrap. + # This is so that the correct gid/uid are set. + U_ID=$(echo $GU_IDS | cut -d: -f1) + G_ID=$(echo $GU_IDS | cut -d: -f2) + + id myuser &>/dev/null && userdel myuser + rm -rf /myuser + groupadd myuser -g "$G_ID" + useradd myuser -u "$U_ID" -g "$G_ID" --home /myuser --create-home + su myuser -c "bash $BASH_SOURCE" + exit +fi + +#latexmk -xelatex -shell-escape ./main.tex +latexmk -pdf -shell-escape ./main.tex + +