A Docker image to ease building Python applications that depend on LaTeX
- Python 3.8 - 3.12, based on the official
slim-*
images, where*
includes:bullseye
bookworm
- LaTeX environment with
texlive-full
- Pandoc for converting from one markup format to another
You can pull the pre-built image from Docker Hub:
docker pull engineervix/python-latex:3.12-slim-bookworm
Replace 3.12
and bookworm
with the desired Python version and Debian release, respectively.
To run a container using the image:
docker run -it --rm engineervix/python-latex:3.12-slim-bookworm
This will start an interactive shell inside the container.
Here's an example of a Dockerfile
for your Python application:
FROM engineervix/python-latex:3.12-slim-bookworm
WORKDIR /app
# Copy your application files
COPY . /app
# Install any necessary dependencies
RUN pip install -r requirements.txt
# Command to run your application
CMD ["python", "your_script.py"]
Build and run your container:
docker build -t my-python-latex-app .
docker run -it --rm my-python-latex-app
You can directly use LaTeX and Pandoc commands within the container. For example, to convert a Markdown file to a PDF:
- Start a container and mount your current directory:
docker run -it --rm -v $(pwd):/workspace -w /workspace engineervix/python-latex:3.12-slim-bookworm
- Inside the container, use Pandoc to convert your file:
pandoc input.md -o output.pdf
Or compile a LaTeX document:
pdflatex document.tex