TeX Live environments on Alpine Linux
291
This repository provides a docker image of TeX Live environments on Alpine Linux, tailored for different use cases.
This project builds six different Docker images using a single Dockerfile, each corresponding to a different TeX Live scheme. Additionally, it allows building any combination of installed packages, schemes, and collections as specified by the user (see TeX Live Docker repository for more information on how to build custom images):
Note: Due to the interaction between tikz (from the pgf package) and lastpage, the lastpage package may not function correctly on the first compilation. It may be unable to access the .aux file, necessitating a second compilation to resolve the issue and generate the final output properly.
To utilize any of these images, execute them as you would with any standard Docker image. The /project volume is used to share your LaTeX project with the Docker container, and the compiled output will also be placed inside this volume.
For more complex build processes, where a simple pdflatex command or its variations might not be sufficient, consider creating a build.sh script to handle the build process. This script can include multiple LaTeX runs, bibliography generation, and other necessary steps.
Note: The examples provided use pdflatex for compiling documents. However, not all Docker images may include pdflatex. Depending on the TeX Live scheme or additional packages installed, you might need to use other LaTeX engines or adjust your commands accordingly.
To use an image, you can run a container using the following command:
docker run --rm -v $(pwd):/project your-docker-registry/texlive:<image_tag> pdflatex /project/main.tex
Replace <image_tag> with one of the following:
Note: Ensure you use a POSIX-compliant shell (like
sh). Scripts written inbashor other shells may not work as expected.
Create a build.sh script in your project directory:
#!/bin/sh
# Run pdflatex multiple times if needed
pdflatex /project/main.tex
bibtex /project/main
pdflatex /project/main.tex
pdflatex /project/main.tex
Make sure to give execute permissions to your script:
chmod +x build.sh
Then, run the script inside the Docker container:
docker run --rm -v $(pwd):/project your-docker-registry/texlive:<image_tag> /project/build.sh
Replace <image_tag> with one of the following:
You can also use Docker Compose to manage your LaTeX projects.
Create a docker-compose.yml file:
services:
latex:
image: your-docker-registry/texlive:<image_tag>
volumes:
- .:/project
command: /project/build.sh
Replace <image_tag> with one of the following:
Run the Docker Compose setup:
docker-compose up
Content type
Image
Digest
sha256:2217dc27b…
Size
2 GB
Last updated
about 2 years ago
docker pull gabrielmn/tex-live-docker:full