To make use of Docker's build cache, first try to pull the image with the desired tag that you want to build or update from Docker Hub.
sudo docker pull udsdepend/latex:tag || true
(The above step is not mandatory to build an image. If you don't want to pull the image, then remove the --cache-from
arguments from the following commands.)
# check out the desired branch (= tag)
git checkout <branch>
# build the image
sudo docker build --pull --cache-from udsdepend/latex:tag --tag udsdepend/latex:tag .
sudo docker build --pull --cache-from udsdepend/latex:tag --tag udsdepend/latex:tag "https://github.com/udsdepend/latex-docker.git#tag"
Before pushing a new tag to Docker Hub, please make sure to follow these steps to verify the successful installation of TeX Live.
- Processing the LaTeX Sample Document:
Check the output log for warnings or errors. The final lines should look like:
sudo docker run --rm -it udsdepend/latex:tag pdflatex sample2e
Output written on sample2e.pdf (3 pages, 142110 bytes). Transcript written on sample2e.log.
- Run the LaTeX Test Program:
Follow the on-screen instructions. Especially make sure that the output contains no error messages starting with
sudo docker run --rm -it udsdepend/latex:tag pdflatex ltxcheck
! BAD
.
# log in to Docker Hub
sudo docker login
# push the image
sudo docker push udsdepend/latex:tag
# remove the saved credentials
sudo docker logout