diff options
author | Aaron LI <aly@aaronly.me> | 2024-12-10 13:41:10 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2024-12-10 13:42:23 +0800 |
commit | b4b446d0acc96f3b30b1d45bae378d13938fd667 (patch) | |
tree | b50bf49147972c9b6c396d2ee9c3569c49b3917a | |
parent | d0630a0f0ea5652b9a712977df74d8a192989ee1 (diff) | |
download | resume-b4b446d0acc96f3b30b1d45bae378d13938fd667.tar.bz2 |
Add Dockerfile to create the builder image
Based on debian:bookworm (12), and the created image is ~1.1GB.
See also: PR #22
-rw-r--r-- | Dockerfile | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c085ed --- /dev/null +++ b/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:bookworm + +ENV DEBIAN_FRONTEND=noninteractive + +ARG APT_MIRROR="https://mirror.sjtu.edu.cn/" +ARG TEXLIVE_MIRROR="https://mirror.ctan.org/systems/texlive" + +# Debian 12 (bookworm) uses "/etc/apt/sources.list.d/debian.sources". +# Enable the "contrib" component for the "fonts-ibm-plex" package. +RUN sed -i'.bak' \ + -e "s|^URIs: http://deb.debian.org/|URIs: ${APT_MIRROR%/}/|" \ + -e "s|^Components: .*$|Components: main contrib|" \ + /etc/apt/sources.list.d/debian.sources + +# APT SSL issue: +# The mirror may use a Let's Encrypt certificate that requires an updated +# "ca-certificates" than the one in 12 (bookworm). So set the +# "Acquire::https::Verify-Peer=false" option to workaround the issue. +# +# TeXLive packages: +# * texlive-lang-cjk -> xeCJK.sty +# * texlive-lang-chinese -> ctexhook.sty +# * texlive-fonts-recommended -> pzdr.tfm (required by mktextfm pzdr) +# +# FontAwesome: +# Debian has packaged the FontAwesome font in the "textlive-fonts-extra" +# package, but that's a HUGE one and thus costs unnecessary space. +# Therefore, it's better to install the only needed package with tlmgr. +# Since the CTAN repo can become newer and then break the builtin download +# feature of tlmgr, we manually download the package and install it. +RUN set -ex && \ + apt-get -o "Acquire::https::Verify-Peer=false" update && \ + apt-get -o "Acquire::https::Verify-Peer=false" -y \ + install ca-certificates && \ + apt-get -y --no-install-recommends install \ + make ghostscript \ + latexmk texlive-xetex \ + texlive-lang-cjk texlive-lang-chinese \ + fonts-ibm-plex fonts-noto-cjk texlive-fonts-recommended && \ + apt-get -y --no-install-recommends install \ + wget xz-utils && \ + rm -rf /var/lib/apt/lists/* +RUN set -ex && \ + wget ${TEXLIVE_MIRROR}/tlnet/archive/fontawesome5.tar.xz && \ + tlmgr --usermode init-usertree && \ + tlmgr --usermode install --file fontawesome5.tar.xz && \ + rm -f fontawesome5.tar.xz |