Skip to content
Build instructions for a Latex Docker image
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

latex: Docker-Image for creating LaTeX documents

In General

LaTeX is a programming language for typesetting documents. One of the main features of this language is that the original document is just a plain text file which can be edited with any text editor. This enables us to have these text files under a version control system like Git. You can easily go back to a previous version with the help of the version control system. Additionally, build pipelines came up. There are some services available on the Internet which even give you free build minutes in their pipeline implementation. So, this LaTeX-Docker-images uses these pipelines to enable an auto-generation of the outcoming PDF file with every check-in to the repository.

This docker image enables you to use the CI-pipeline provided by GitLab or BitBucket to automatically create a PDF document out of your latex files every time you push them to your Git-repository.

But you can also use this Docker-Image locally to compile LaTeX-files on your machine.

On Docker Hub

The image is available at Docker Hub at .

CI-pipeline with Gitlab

You can use the image the following way on GitLab by using the file .gitlab-ci.yml:

image: ctornau/latex

  stage: build
      - main.pdf
    - latexmk -pdf main.tex

Please follow the link to a sample GitLab project.

CI-pipeline with BitBucket

If you prefer BitBucket place the following in the file named bitbucket-pipelines.yml within your repository:

image: ctornau/latex

        - step:
            name: Build and Upload PDF
                - latexmk -pdf main.tex
                - curl -X POST "https://${BB_AUTH_STRING}${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"main.pdf"
                - main.pdf

To have a working BitBucket-pipeline please make sure that the secret variable BB_AUTH_STRING contains the secret to access the download area of BitBucket. Instructions to do this are placed at .

Please follow the link to an example BitBucket repository.

Run it locally

Have your LaTeX-files to compile in the following directory c:\your\location and run the following Docker command

docker run -v c:\your\location\:/latex ctornau/latex /bin/sh -c "cd latex && latexmk -pdf main.tex"

You can’t perform that action at this time.