Dockerfile 2.07 KB
Newer Older
Mahito TANNO's avatar
Mahito TANNO committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
FROM frolvlad/alpine-glibc:latest

LABEL maintainer="Mahito Tanno <pb94.mahito@gmail.com>"

ARG TL_VERSION="2019"
ARG TL_REPO="http://mirror.ctan.org/systems/texlive"

ENV TEXMFLOCAL="/usr/local/texlive/texmf-local" \
    PATH="/usr/local/texlive/${TL_VERSION}/bin/x86_64-linux:$PATH"

WORKDIR /tmp/install-tl-unx

RUN apk update && apk add --no-cache \
        perl fontconfig-dev freetype-dev make git && \
    apk add --no-cache --virtual .build-tool gnupg wget tar unzip xz && \
    # Install TeX Live
    wget -qO - "${TL_REPO}/tlnet/install-tl-unx.tar.gz" | \
    tar xz -C /tmp/install-tl-unx --strip-components 1 && \
    echo -e "selected_scheme scheme-basic\n\
tlpdbopt_autobackup 0\n\
tlpdbopt_install_docfiles 0\n\
tlpdbopt_install_srcfiles 0" > texlive.profile && \
    ./install-tl -profile ./texlive.profile -repository "${TL_REPO}/tlnet/"  && \
    tlmgr install \
        collection-latexextra \
        collection-fontsrecommended collection-fontsextra \
        collection-bibtexextra \
        collection-luatex \
        collection-langjapanese \
        latexmk && \
    # Install Source Han Serif/Sans font
    wget -q https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifJ_EL-M.zip && \
    wget -q https://github.com/adobe-fonts/source-han-serif/raw/release/OTF/SourceHanSerifJ_SB-H.zip && \
    wget -q https://github.com/adobe-fonts/source-han-sans/raw/release/OTF/SourceHanSansJ.zip && \
    mkdir -p /usr/share/fonts && \
    unzip -j 'SourceHanSerif*.zip' "*.otf" -d /usr/share/fonts && \
    unzip -j 'SourceHanSansJ.zip' "*.otf" -d /usr/share/fonts && \
    mkdir -p "${TEXMFLOCAL}/fonts/opentype/adobe/sourcehanserif" && \
    mkdir -p "${TEXMFLOCAL}/fonts/opentype/adobe/sourcehansans" && \
    ln -s /usr/share/fonts/SourceHanSerif* "${TEXMFLOCAL}/fonts/opentype/adobe/sourcehanserif/" && \
    ln -s /usr/share/fonts/SourceHanSans* "${TEXMFLOCAL}/fonts/opentype/adobe/sourcehansans/" && \
    fc-cache -fv && luaotfload-tool --update --force && mktexlsr && \
    # Clean up
    rm -rf /tmp/* && \
    apk del --purge .build-tool

WORKDIR /work
CMD ["/bin/sh"]