diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..08a1a8f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,102 @@ +name: Deploy + +on: + push: + branches: + - master + schedule: + - cron: 0 18 * * 0 + +jobs: + + build-infraonly: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Login to Dockerhub + run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin + + - name: Build infraonly-scratch + working-directory: ./scratch + run: docker build -t ${{secrets.DOCKERHUB_USER}}/latex:infraonly-scratch --build-arg SCHEME=infraonly . + + - name: Upload infraonly-scratch image + run: docker push ${{secrets.DOCKERHUB_USER}}/latex:infraonly-scratch + + - name: Upload infraonly + run: | + docker tag ${{secrets.DOCKERHUB_USER}}/latex:infraonly-scratch ${{secrets.DOCKERHUB_USER}}/latex:infraonly + docker push ${{secrets.DOCKERHUB_USER}}/latex:infraonly + + build-scratch: + runs-on: ubuntu-latest + strategy: + matrix: + scheme: [minimal, basic, small, context, gust, medium, tetex, full] + include: + - scheme: full + isLatest: true + fail-fast: false + steps: + - uses: actions/checkout@v2 + + - name: Login to Dockerhub + run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin + + - name: Build ${{matrix.scheme}}-scratch + working-directory: ./scratch + run: docker build -t ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch --build-arg SCHEME=${{matrix.scheme}} . + + - name: Upload ${{matrix.scheme}}-scratch image + run: docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch + + - name: Upload ${{matrix.scheme}} + run: | + docker tag ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}} + docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}} + + - name: Tag as latest + if: matrix.isLatest + run: | + docker tag ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-scratch ${{secrets.DOCKERHUB_USER}}/latex:latest + docker push ${{secrets.DOCKERHUB_USER}}/latex:latest + + build-incremental: + runs-on: ubuntu-latest + needs: [build-infraonly] + strategy: + max-parallel: 1 + fail-fast: true + matrix: + scheme : [minimal, basic, small, context, gust, medium, tetex, full] + include: + - scheme: minimal + source: infraonly + - scheme: basic + source: minimal-incremental + - scheme: small + source: basic-incremental + - scheme: context + source: small-incremental + - scheme: gust + source: context-incremental + - scheme: medium + source: gust-incremental + - scheme: tetex + source: medium-incremental + - scheme: full + source: tetex-incremental + + steps: + - uses: actions/checkout@v2 + + - name: Login to Dockerhub + run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login -u ${{secrets.DOCKERHUB_USER}} --password-stdin + + - name: Build ${{matrix.scheme}} + working-directory: ./incremental + run: docker build -t ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-incremental --build-arg SOURCE=${{matrix.source}} --build-arg SCHEME=${{matrix.scheme}} . + + - name: Upload ${{matrix.scheme}}-incremental + run: docker push ${{secrets.DOCKERHUB_USER}}/latex:${{matrix.scheme}}-incremental diff --git a/README.md b/README.md index 91771e0..2dd3ac9 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,21 @@ +![Deploy](https://github.com/icaotix-docker/latex/workflows/Deploy/badge.svg) + # Schemes/Tags ## Sizes -* `infraonly` - infrastructure-only scheme (no TeX at all) -* `minimal` - minimal scheme (plain only) -* `basic` - basic scheme (plain and latex) -* `small` - small scheme (basic + xetex, metapost, a few languages) -* `medium` - medium scheme (small + more packages and languages) -* `full`, `latest` - full scheme (everything) +* `infraonly`, `infraonly-scratch` - infrastructure-only scheme (no TeX at all) +* `minimal`, `minimal-scratch`, `minimal-incremental` - minimal scheme (plain only) +* `basic`, `basic-scratch`, `basic-incremental` - basic scheme (plain and latex) +* `small`, `small-scratch`, `small-incremental` - small scheme (basic + xetex, metapost, a few languages) +* `medium`, `medium-scratch`, `medium-incremental` - medium scheme (small + more packages and languages) +* `full`, `full-scratch`, `full-incremental`, `latest` - full scheme (everything) ## Extra Schemes -* `gust` - GUST TeX Live scheme -* `context` - ConTeXt scheme -* `tetex` - teTeX scheme (more than medium, but nowhere near full) +* `gust`, `gust-scratch`, `gust-incremental` - GUST TeX Live scheme +* `context`, `context-scratch`, `context-incremental` - ConTeXt scheme +* `tetex`, `tetex-scratch`, `tetex-incremental` - teTeX scheme (more than medium, but nowhere near full) -## Build Info (Image tree) +## Build Info `-incremental` (Image tree) +Images with this tag have all previous layers built in, use them for better caching. ``` infraonly (base image with ubuntu:18.04) +---> minimal @@ -24,8 +27,12 @@ infraonly (base image with ubuntu:18.04) +---> tetex +---> full ``` +NOTE: infraonly has no `incremental` tag. -# How to use +## Build Info `-scratch` +These images are built from the base ubuntu:18.04 image. They only have one latex layer. They are usually a little bit smaller than their `incremental` counterparts. The `scratch` image is default when used with no tag extension. Also `latest` is built from scratch and is the same as `full` and `full-scratch`. + +# How to use the image Mount your source code at `/data` and run whatever you want with LaTeX. # How to extend an Image @@ -34,7 +41,7 @@ To extend the one of the docker-images with your packages. `FROM icaotix/latex:` #### Install latex packages -` RUN tlmgr install latexmk ` +` RUN tlmgr install latexmk ` ` RUN tlmgr install biber ` #### Minted + Pygments diff --git a/ctan/Dockerfile.basic b/ctan/Dockerfile.basic deleted file mode 100644 index 336e06e..0000000 --- a/ctan/Dockerfile.basic +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:minimal - -RUN tlmgr install scheme-basic diff --git a/ctan/Dockerfile.context b/ctan/Dockerfile.context deleted file mode 100644 index 125a1b4..0000000 --- a/ctan/Dockerfile.context +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:small - -RUN tlmgr install scheme-context diff --git a/ctan/Dockerfile.full b/ctan/Dockerfile.full deleted file mode 100644 index eb2163e..0000000 --- a/ctan/Dockerfile.full +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:tetex - -RUN tlmgr install scheme-full \ No newline at end of file diff --git a/ctan/Dockerfile.gust b/ctan/Dockerfile.gust deleted file mode 100644 index 4a3916d..0000000 --- a/ctan/Dockerfile.gust +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:context - -RUN tlmgr install scheme-gust \ No newline at end of file diff --git a/ctan/Dockerfile.medium b/ctan/Dockerfile.medium deleted file mode 100644 index e5052eb..0000000 --- a/ctan/Dockerfile.medium +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:gust - -RUN tlmgr install scheme-medium diff --git a/ctan/Dockerfile.minimal b/ctan/Dockerfile.minimal deleted file mode 100644 index c16dfb7..0000000 --- a/ctan/Dockerfile.minimal +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:infraonly - -RUN tlmgr install scheme-minimal diff --git a/ctan/Dockerfile.small b/ctan/Dockerfile.small deleted file mode 100644 index a119f75..0000000 --- a/ctan/Dockerfile.small +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:basic - -RUN tlmgr install scheme-small diff --git a/ctan/Dockerfile.tetex b/ctan/Dockerfile.tetex deleted file mode 100644 index 7d3af10..0000000 --- a/ctan/Dockerfile.tetex +++ /dev/null @@ -1,3 +0,0 @@ -FROM icaotix/latex:medium - -RUN tlmgr install scheme-tetex diff --git a/incremental/Dockerfile b/incremental/Dockerfile new file mode 100644 index 0000000..8bf2944 --- /dev/null +++ b/incremental/Dockerfile @@ -0,0 +1,6 @@ +ARG SOURCE + +FROM icaotix/latex:$SOURCE +ARG SCHEME + +RUN tlmgr install scheme-${SCHEME} \ No newline at end of file diff --git a/ctan/Dockerfile.infraonly b/scratch/Dockerfile similarity index 85% rename from ctan/Dockerfile.infraonly rename to scratch/Dockerfile index 9f564d3..1711bb2 100644 --- a/ctan/Dockerfile.infraonly +++ b/scratch/Dockerfile @@ -8,11 +8,12 @@ RUN apt-get update -q \ && apt-get install -qy build-essential wget libfontconfig1 \ && rm -rf /var/lib/apt/lists/* -# Install TexLive with scheme-infraonly +ARG SCHEME + RUN wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz \ && mkdir /install-tl-unx \ && tar -xvf install-tl-unx.tar.gz -C /install-tl-unx --strip-components=1 \ - && echo "selected_scheme scheme-infraonly" >> /install-tl-unx/texlive.profile \ + && echo "selected_scheme scheme-${SCHEME}" >> /install-tl-unx/texlive.profile \ && /install-tl-unx/install-tl -profile /install-tl-unx/texlive.profile \ && rm -r /install-tl-unx \ && rm install-tl-unx.tar.gz diff --git a/ubuntu/1804/Dockerfile b/ubuntu/1804/Dockerfile deleted file mode 100644 index c4ea48a..0000000 --- a/ubuntu/1804/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:18.04 - -ENV DEBIAN_FRONTEND noninteractive -WORKDIR /data - -RUN apt-get update -q && apt-get install -qy \ - texlive-base biber\ - python-pygments gnuplot \ - make git \ - && rm -rf /var/lib/apt/lists/* diff --git a/ubuntu/2004/Dockerfile b/ubuntu/2004/Dockerfile deleted file mode 100644 index e529efa..0000000 --- a/ubuntu/2004/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM ubuntu:20.04 - -ENV DEBIAN_FRONTEND noninteractive -WORKDIR /data - -RUN apt-get update -q && apt-get install -qy \ - texlive-base biber\ - python-pygments gnuplot \ - make git \ - && rm -rf /var/lib/apt/lists/*