Repository navigation
Expand file tree
/
Copy pathContainerfile
More file actions
162 lines (144 loc) · 5.83 KB
/
Copy pathContainerfile
File metadata and controls
162 lines (144 loc) · 5.83 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# syntax=docker/dockerfile:1
# Must match the version expected by the installed LTeX+ extension.
# LTeX+ 15.7.1 -> ltex-ls-plus 18.7.0
# see DependencyManager._toBeDownloadedLtexLsVersion in vscode-ltex-plus
ARG LTEX_LS_VERSION=18.7.0
# Frozen years: https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/<year>/tlnet-final
ARG TL_YEAR=2026
# Fixed mirror: the mirror.ctan.org redirector sometimes hands out dead mirrors
ARG TL_REPO=https://ftp.fau.de/ctan/systems/texlive/tlnet
ARG BASE_IMAGE=mcr.microsoft.com/devcontainers/base:ubuntu26.04
FROM alpine:3.22 AS downloader
ARG TARGETARCH
ARG LTEX_LS_VERSION
RUN apk add --no-cache curl
RUN set -eux; \
case "${TARGETARCH}" in \
amd64) ARCH=x64 ;; \
arm64) ARCH=aarch64 ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac; \
curl -fsSL -o /tmp/ltex.tar.gz \
"https://github.com/ltex-plus/ltex-ls-plus/releases/download/${LTEX_LS_VERSION}/ltex-ls-plus-${LTEX_LS_VERSION}-linux-${ARCH}.tar.gz"; \
mkdir -p /opt/ltex; \
tar -xzf /tmp/ltex.tar.gz -C /opt/ltex --strip-components=2 --no-same-owner; \
rm /tmp/ltex.tar.gz; \
test -x /opt/ltex/bin/ltex-ls-plus
FROM ${BASE_IMAGE} AS texlive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG TL_YEAR
ARG TL_REPO
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends ca-certificates curl perl xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN set -eux; \
mkdir -p /tmp/install-tl; \
curl -fsSL "${TL_REPO}/install-tl-unx.tar.gz" \
| tar -xz -C /tmp/install-tl --strip-components=1; \
printf '%s\n' \
'selected_scheme scheme-full' \
"TEXDIR /usr/local/texlive/${TL_YEAR}" \
'TEXMFLOCAL /usr/local/texlive/texmf-local' \
'instopt_adjustpath 0' \
'instopt_letter 0' \
'tlpdbopt_autobackup 0' \
'tlpdbopt_install_docfiles 0' \
'tlpdbopt_install_srcfiles 0' \
> /tmp/texlive.profile; \
/tmp/install-tl/install-tl \
--profile=/tmp/texlive.profile \
--repository="${TL_REPO}"; \
rm -rf /tmp/install-tl /tmp/texlive.profile \
/usr/local/texlive/${TL_YEAR}/install-tl* \
/usr/local/texlive/${TL_YEAR}/tlpkg/backups; \
BIN="/usr/local/texlive/${TL_YEAR}/bin/$(uname -m)-linux"; \
test -x "${BIN}/tlmgr"; \
"${BIN}/tlmgr" --version | grep -q "version ${TL_YEAR}"; \
ln -s "${BIN}" /usr/local/texlive/bin
FROM ${BASE_IMAGE}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG TL_YEAR
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
bats \
curl \
fontconfig \
ghostscript \
git \
git-lfs \
hunspell \
hunspell-de-de \
hunspell-en-us \
hunspell-tools \
inkscape \
libhunspell-dev \
locales \
make \
neovim \
pandoc \
perl \
poppler-utils \
procps \
python3 \
&& rm -rf /var/lib/apt/lists/*
# tlmgr path add: /etc/profile overrides PATH in login shells
COPY --from=texlive /usr/local/texlive /usr/local/texlive
ENV PATH="/usr/local/texlive/bin:${PATH}"
RUN set -eux; \
tlmgr path add; \
cp "/usr/local/texlive/${TL_YEAR}/texmf-var/fonts/conf/texlive-fontconfig.conf" \
/etc/fonts/conf.d/09-texlive.conf; \
fc-cache -fs >/dev/null; \
latexmk -v; \
biber --version; \
latexminted --version; \
kpsewhich -var-value shell_escape_commands | tr , '\n' | grep -qx latexminted; \
kpsewhich zugferd.sty zugferd-invoice.sty
# ltex-ls-plus incl. bundled JDK 21 and all LanguageTool languages
COPY --from=downloader --chown=root:root /opt/ltex /opt/ltex
ENV PATH="/opt/ltex/bin:${PATH}"
RUN ltex-ls-plus --version
# Replaces the base image label: keep its entries (the first three) in sync on base updates
LABEL devcontainer.metadata='[ \
{ "id": "ghcr.io/devcontainers/features/common-utils:2" }, \
{ "id": "ghcr.io/devcontainers/features/git:1", \
"customizations": { "vscode": { "settings": { \
"github.copilot.chat.codeGeneration.instructions": [ \
{ "text": "This dev container includes an up-to-date version of Git, built from source as needed, pre-installed and available on the `PATH`." } \
] } } } }, \
{ "remoteUser": "vscode" }, \
{ "customizations": { "vscode": { \
"extensions": [ \
"ExodiusStudios.comment-anchors", \
"james-yu.latex-workshop", \
"ltex-plus.vscode-ltex-plus", \
"tecosaur.latex-utilities" \
], \
"settings": { \
"commentAnchors.tags.matchPrefix": [ "#", "%" ], \
"files.trimTrailingWhitespace": true, \
"latex-workshop.latex.recipes": [ \
{ "name": "latexmk", "tools": [ "latexmk" ] }, \
{ "name": "latexmk (solution)", "tools": [ "latexmk-solution" ] }, \
{ "name": "latexmk (document + solution)", "tools": [ "latexmk", "latexmk-solution" ] } \
], \
"latex-workshop.latex.tools": [ \
{ "name": "latexmk", "command": "latexmk", "env": {}, \
"args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", \
"--shell-escape", "-pdf", "-outdir=%OUTDIR%", "%DOC%" ] }, \
{ "name": "latexmk-solution", "command": "latexmk", "env": {}, \
"args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", \
"--shell-escape", "-pdf", "-outdir=%OUTDIR%", \
"-jobname=%DOCFILE%-Solution", "%DOC%" ] } \
], \
"latex-workshop.synctex.afterBuild.enabled": true, \
"latex-workshop.view.pdf.trim": 1, \
"latex-workshop.view.pdf.viewer": "tab", \
"ltex.language": "en-US", \
"ltex.latex.commands": { "\\moderncvtheme{}": "ignore" }, \
"ltex.ltex-ls.path": "/opt/ltex" \
} } } } \
]'
WORKDIR /workspaces