Added Dockerfile for compiling

This commit is contained in:
Benedikt Galbavy 2025-01-13 20:06:10 +01:00
parent a57c35de74
commit 72d46d08eb
2 changed files with 34 additions and 0 deletions

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
# Use a lightweight TeX Live base image
FROM texlive/texlive:latest
# Install required packages
RUN apt-get update && apt-get install -y --no-install-recommends \
texlive-fonts-extra \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Create a user and group with the same IDs as the host user
ARG UID=1000
ARG GID=1000
RUN groupadd -g ${GID} user && \
useradd -m -u ${UID} -g ${GID} user
# Switch to the newly created user
USER user
# Set the working directory in the container
WORKDIR /workdir
# Copy the LaTeX project into the container
COPY . /workdir
# Set the default command to compile the LaTeX file
CMD ["latexmk", "-pdflua", "slides.tex", "-shell-escape"]

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# Compile using docker:
```sh
# Build image
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t latexmk-luatex .
# Compile .pdf
docker run --rm -v $(pwd):/workdir latexmk-luatex
```