GithubHelp home page GithubHelp logo

kjarosh / latex-docker Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 3.0 43 KB

A set of lightweight Docker images for building LaTeX documents

License: MIT License

Dockerfile 48.02% Makefile 51.98%
dockerfile docker-container latex texlive

latex-docker's Introduction

LaTeX in Docker

GitHub license GitHub build status GitHub release DockerHub GitHub Container Registry

Docker Image Size (minimal) Docker Image Size (basic) Docker Image Size (small) Docker Image Size (medium) Docker Image Size (full)

This repository defines a set of images which may be used to run LaTeX in a container, for example in CI/CD. They come in several flavors, which correspond to TeX Live schemes (see the table below). The default scheme is full which contains all packages.

If some package is missing you can always use tlmgr to install it. The image is based on alpine, so system packages may be installed using apk.

Scheme Image Size
minimal kjarosh/latex:2024.1-minimal ~40 MB
basic kjarosh/latex:2024.1-basic ~90 MB
small kjarosh/latex:2024.1-small ~180 MB
medium kjarosh/latex:2024.1-medium ~500 MB
full kjarosh/latex:2024.1 ~2 GB

The images are made in such a way that they reuse layers. For example full will add a layer to medium with packages that are not present there. This makes it easier to manage and saves space.

Versions are in the format of <major>.<minor>. The major version relates to TeX Live version (which is the year), the minor version is the version of the image within the given year. In order for tlmgr to work, the year in the version must be current, because the default mirror does not support archival TeX Live releases.

GitHub Actions

Example using make:

name: Compile LaTeX
on: [ push ]
jobs:
  container:
    runs-on: ubuntu-latest
    container: kjarosh/latex:2024.1
    steps:
      - name: Install make
        run: apk add make
      - name: Checkout
        uses: actions/checkout@v2
      - name: Build
        run: make
      - name: Upload document
        uses: actions/upload-artifact@v2
        with:
          name: main-document
          path: out/index.pdf

GitLab CI/CD

Example using make:

image: kjarosh/latex:2024.1

build:
  stage: build
  before_script:
    - apk add make
  script:
    - make build
  artifacts:
    paths:
      - out/index.pdf

latex-docker's People

Contributors

kjarosh avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

latex-docker's Issues

Is TL_YEAR really needed?

First, thanks for making this repo, it helped me a lot today.

I would like to ask one question about the TL_YEAR=2023 constant in the Dockerfile.
In the Readme, you say the correct year is necessary for tlmgr to work. However, I tried to remove the constant completely and the tlmgr still works. To explain why I am asking - I have to adjust your Dockerfile to fit my needs and my project will be deployed with CD. So I am trying to prevent any issues that could arise when the year changes.

Could you please explain why do you think the tlmgr won't work or have I misunderstood something? To be more explicit, here is how I adjusted your code and the image builds successfully:

FROM python:3.8.16-alpine3.18
ARG TL_MIRROR="https://texlive.info/CTAN/systems/texlive/tlnet"

RUN apk add --no-cache perl curl fontconfig libgcc gnupg && \
     mkdir "/tmp/texlive" && cd "/tmp/texlive" && \
     wget "$TL_MIRROR/install-tl-unx.tar.gz" && \
     tar xzvf ./install-tl-unx.tar.gz && \
     ( \
         echo "selected_scheme scheme-minimal" && \
         echo "instopt_adjustpath 0" && \
         echo "tlpdbopt_install_docfiles 0" && \
         echo "tlpdbopt_install_srcfiles 0" && \
         echo "TEXDIR /opt/texlive" && \
         echo "TEXMFLOCAL /opt/texlive/texmf-local" && \
         echo "TEXMFSYSCONFIG /opt/texlive/texmf-config" && \
         echo "TEXMFSYSVAR /opt/texlive/texmf-var" && \
         echo "TEXMFHOME ~/.texmf" \
     ) > "/tmp/texlive.profile" && \
     "./install-tl-"*"/install-tl" --location "$TL_MIRROR" -profile "/tmp/texlive.profile" && \
     rm -vf "/opt/texlive/install-tl" && \
     rm -vf "/opt/texlive/install-tl.log" && \
     rm -vrf /tmp/*

ENV PATH="${PATH}:/opt/texlive/bin/x86_64-linuxmusl"

# Change all TL_SCHEME_XXX to "y" if you want it.
ARG TL_SCHEME_BASIC="y"
RUN if [ "$TL_SCHEME_BASIC" = "y" ]; then tlmgr install scheme-basic; fi

ARG TL_SCHEME_SMALL=""
RUN if [ "$TL_SCHEME_SMALL" = "y" ]; then tlmgr install scheme-small; fi

ARG TL_SCHEME_MEDIUM=""
RUN if [ "$TL_SCHEME_MEDIUM" = "y" ]; then tlmgr install scheme-medium; fi

ARG TL_SCHEME_FULL=""
RUN if [ "$TL_SCHEME_FULL" = "y" ]; then tlmgr install scheme-full; fi

RUN tlmgr install ragged2e

Thank you in advance for your answer.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

dockerfile
Dockerfile
  • alpine 3.19.1
github-actions
.github/workflows/docker.yml
  • actions/checkout v4
  • docker/login-action v3
  • docker/login-action v3

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.