Commit d7379077 authored by Jari-Matti Mäkelä's avatar Jari-Matti Mäkelä
Browse files

Initial commit

parents
Pipeline #39398 canceled with stage
image: docker:latest
variables:
REPO: tech/soft/thesis-builder
build:
stage: build
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY/$REPO:latest .
- docker push $CI_REGISTRY/$REPO:latest
# https://tug.org/texlive/quickinstall.html
FROM debian:stable
ENV DEBIAN_FRONTEND=noninteractive
ARG TEXMIRROR=http://ftp.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet/
ARG TEXPROFILE=texlive.profile
# the profile file contains list of installable tex configuration
# can be regenerated with 'install-tl'.
COPY $TEXPROFILE .
# update debian's packages
RUN cat $TEXPROFILE && \
#
mkdir -p /usr/share/man/man1 && \
apt-get -qq update -y && \
#
# deps for texlive, verapdf, make, pdf cmdline utils, pygments/minted, pandoc
apt-get install -y texlive-base wget make ghostscript poppler-utils \
fontconfig inotify-tools openjdk-11-jre-headless \
python3-pygments python3-pandocfilters \
pandoc-citeproc pandoc && \
#
# clean up
apt-get autoremove -y --purge && \
apt-get clean && \
rm -r /var/lib/apt/lists/* && \
#
# fix python's path
ln -s /usr/bin/python3 /usr/bin/python && \
#
# verapdf validator & texlive installer
wget https://tech.utugit.fi/soft/tools/veraPDF-apps/greenfield-apps-latest.jar -O /pdfa.jar && \
echo 'java -cp /pdfa.jar org.verapdf.apps.GreenfieldCliWrapper --format text -v "$@"' > /usr/local/bin/pdfa-validate && \
chmod +x /usr/local/bin/pdfa-validate && \
#
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
tar xf install-tl-unx.tar.gz && \
#
#
fc-cache -vr && \
#
# install texlive
./install-tl-*/install-tl --profile $TEXPROFILE --location $TEXMIRROR && \
rm -fr install-tl* && \
#
# add texlive to the system path
echo 'PATH='$(echo /usr/local/texlive/*/bin/*)':$PATH' >> /etc/bash.bashrc
ENV PATH=$PATH:/usr/local/texlive/2021/bin/x86_64-linux/
Simple Docker image for building thesis documents
## Contents
* [TeXLive](https://tug.org/texlive/quickinstall.html) (latest)
* [VeraPDF](https://verapdf.org/), see https://gitlab.utu.fi/tech/soft/tools/veraPDF-apps
* [Pygments](https://pygments.org/) / [Minted](https://ctan.org/pkg/minted)
* [Pandoc](https://pandoc.org/)
* Poppler utils (cmdline pdf utils)
* GNU Make
* Python 3 & OpenJDK 11
* Debian stable base image
## Profiles
* `texlive-minimal.profile`: TeXLive minimal scheme
* `texlive-small.profile`: TeXLive small scheme
* `texlive.profile`: TeXLive custom scheme (medium + some extras)
## Fetching the image from UTU GitLab
```sh
$ docker login registry.gitlab.utu.fi
$ docker pull registry.gitlab.utu.fi/tech/soft/thesis-builder
## Using from the command line
```sh
$ docker run --mount type=bind,source=$(pwd),target=/src -it registry.gitlab.utu.fi/tech/soft/thesis-builder:latest
```
## Using in GitLab CI
```yaml
image: registry.gitlab.utu.fi/tech/soft/thesis-builder:latest
build:
stage: build
script:
- cd latex
- latexmk -pdf --shell-escape thesis.tex
artifacts:
paths:
- thesis.pdf
validate:
stage: test
script:
- pdfa-validate thesis.pdf|grep '^PASS'
allow_failure: true
pages:
stage: deploy
script:
- mkdir -p public/
- cp thesis.pdf public/
only:
- master
artifacts:
paths:
- public/
```
docker build --build-arg TEXPROFILE=texlive-minimal.profile .
# It will NOT be updated and reflects only the installation profile at installation time.
selected_scheme scheme-minimal
TEXDIR /usr/local/texlive/2021
TEXMFCONFIG ~/.texlive2021/texmf-config
TEXMFHOME ~/texmf
TEXMFLOCAL /usr/local/texlive/texmf-local
TEXMFSYSCONFIG /usr/local/texlive/2021/texmf-config
TEXMFSYSVAR /usr/local/texlive/2021/texmf-var
TEXMFVAR ~/.texlive2021/texmf-var
binary_x86_64-linux 1
instopt_adjustpath 0
instopt_adjustrepo 1
instopt_letter 0
instopt_portable 0
instopt_write18_restricted 1
tlpdbopt_autobackup 1
tlpdbopt_backupdir tlpkg/backups
tlpdbopt_create_formats 1
tlpdbopt_desktop_integration 1
tlpdbopt_file_assocs 1
tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 1
tlpdbopt_install_srcfiles 1
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/share/info
tlpdbopt_sys_man /usr/local/share/man
tlpdbopt_w32_multi_user 1
# It will NOT be updated and reflects only the installation profile at installation time.
selected_scheme scheme-small
TEXDIR /usr/local/texlive/2021
TEXMFCONFIG ~/.texlive2021/texmf-config
TEXMFHOME ~/texmf
TEXMFLOCAL /usr/local/texlive/texmf-local
TEXMFSYSCONFIG /usr/local/texlive/2021/texmf-config
TEXMFSYSVAR /usr/local/texlive/2021/texmf-var
TEXMFVAR ~/.texlive2021/texmf-var
binary_x86_64-linux 1
instopt_adjustpath 0
instopt_adjustrepo 1
instopt_letter 0
instopt_portable 0
instopt_write18_restricted 1
tlpdbopt_autobackup 1
tlpdbopt_backupdir tlpkg/backups
tlpdbopt_create_formats 1
tlpdbopt_desktop_integration 1
tlpdbopt_file_assocs 1
tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 1
tlpdbopt_install_srcfiles 1
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/share/info
tlpdbopt_sys_man /usr/local/share/man
tlpdbopt_w32_multi_user 1
# It will NOT be updated and reflects only the installation profile at installation time.
selected_scheme scheme-custom
TEXDIR /usr/local/texlive/2021
TEXMFCONFIG ~/.texlive2021/texmf-config
TEXMFHOME ~/texmf
TEXMFLOCAL /usr/local/texlive/texmf-local
TEXMFSYSCONFIG /usr/local/texlive/2021/texmf-config
TEXMFSYSVAR /usr/local/texlive/2021/texmf-var
TEXMFVAR ~/.texlive2021/texmf-var
binary_x86_64-linux 1
collection-basic 1
collection-bibtexextra 1
collection-binextra 1
collection-fontsextra 1
collection-fontsrecommended 1
collection-fontutils 1
collection-games 1
collection-langenglish 1
collection-langeuropean 1
collection-latex 1
collection-latexextra 1
collection-latexrecommended 1
collection-mathscience 1
collection-metapost 1
collection-pictures 1
collection-pstricks 1
collection-publishers 1
collection-xetex 1
instopt_adjustpath 0
instopt_adjustrepo 1
instopt_letter 0
instopt_portable 0
instopt_write18_restricted 1
tlpdbopt_autobackup 1
tlpdbopt_backupdir tlpkg/backups
tlpdbopt_create_formats 1
tlpdbopt_desktop_integration 1
tlpdbopt_file_assocs 1
tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 1
tlpdbopt_install_srcfiles 1
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/share/info
tlpdbopt_sys_man /usr/local/share/man
tlpdbopt_w32_multi_user 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment