Skip to content

Commit 7747bf3

Browse files
committed
update texlive cn files from debian:11
1 parent aae574f commit 7747bf3

5 files changed

+225
-1
lines changed

Dockerfile.cn_point_release_image

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
2+
FROM debian:11
3+
4+
ENV LANG=C.UTF-8 \
5+
LC_ALL=C.UTF-8 \
6+
# ConTeXt cache can be created on runtime and does not need to
7+
# increase image size
8+
TEXLIVE_INSTALL_NO_CONTEXT_CACHE=1 \
9+
# As we will not install regular documentation why would we want to
10+
# install perl docs…
11+
NOPERLDOC=1
12+
13+
COPY ./debian-cn-mirror.txt /etc/apt/sources.list
14+
15+
RUN apt-get update && \
16+
# basic utilities for TeX Live installation
17+
apt-get install -qy --no-install-recommends curl git unzip \
18+
# miscellaneous dependencies for TeX Live tools
19+
make fontconfig perl default-jre libgetopt-long-descriptive-perl \
20+
libdigest-perl-md5-perl libncurses5 libncurses6 \
21+
# for latexindent (see #13)
22+
libunicode-linebreak-perl libfile-homedir-perl libyaml-tiny-perl \
23+
# for eps conversion (see #14)
24+
ghostscript \
25+
# for metafont (see #24)
26+
libsm6 \
27+
# for syntax highlighting
28+
python3 python3-pygments \
29+
# for gnuplot backend of pgfplots (see !13)
30+
gnuplot-nox \
31+
equivs \
32+
# at this point also install gpg and gpg-agent to allow tlmgr's
33+
# key subcommand to work correctly (see #21)
34+
gpg gpg-agent \
35+
# we install using rsync so we need to have it installed
36+
rsync && \
37+
rm -rf /var/lib/apt/lists/* && \
38+
rm -rf /var/cache/apt/ && \
39+
# bad fix for python handling
40+
ln -s /usr/bin/python3 /usr/bin/python
41+
42+
# whether to install documentation and/or source files
43+
# this has to be yes or no
44+
ARG DOCFILES=no
45+
ARG SRCFILES=no
46+
ARG SCHEME=full
47+
48+
# the mirror from which we will download TeX Live: in cn
49+
ARG TLMIRRORURL="rsync://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet/"
50+
51+
# whether to create font and ConTeXt caches
52+
ARG GENERATE_CACHES=yes
53+
54+
WORKDIR /tmp
55+
56+
# download and install equivs file for dummy package
57+
RUN curl https://tug.org/texlive/files/debian-equivs-2022-ex.txt --output texlive-local && \
58+
sed -i "s/2022/9999/" texlive-local && \
59+
# freeglut3 does not ship with debian testing, so we remove it because there
60+
# is no GUI need in the container anyway (see #28)
61+
sed -i "/Depends: freeglut3/d" texlive-local && \
62+
# apt-get update && \
63+
# # Mark all texlive packages as installed. This enables installing
64+
# # latex-related packges in child images.
65+
# # Inspired by https://tex.stackexchange.com/a/95373/9075.
66+
# apt-get install -qy --no-install-recommends equivs \
67+
# # at this point also install gpg and gpg-agent to allow tlmgr's
68+
# # key subcommand to work correctly (see #21)
69+
# gpg gpg-agent \
70+
# # we install using rsync so we need to have it installed
71+
# rsync && \
72+
# rm -rf /var/lib/apt/lists/* && \
73+
# apt-get clean && \
74+
# rm -rf /var/cache/apt/
75+
# we need to change into tl-equis to get it working
76+
equivs-build texlive-local && \
77+
dpkg -i texlive-local_9999.99999999-1_all.deb && \
78+
apt-get install -qyf --no-install-recommends && \
79+
# reverse the cd command from above and cleanup
80+
rm -rf ./*texlive* && \
81+
# save some space
82+
apt-get remove -y --purge equivs && \
83+
apt-get autoremove -qy --purge && \
84+
rm -rf /var/lib/apt/lists/* && \
85+
apt-get clean && \
86+
rm -rf /var/cache/apt/
87+
88+
RUN echo "Fetching installation from mirror $TLMIRRORURL" && \
89+
rsync -a --stats "$TLMIRRORURL" texlive && \
90+
cd texlive && \
91+
# create installation profile for full scheme installation with
92+
# the selected options
93+
echo "Building with documentation: $DOCFILES" && \
94+
echo "Building with sources: $SRCFILES" && \
95+
echo "Building with scheme: $SCHEME" && \
96+
# choose complete installation
97+
echo "selected_scheme scheme-$SCHEME" > install.profile && \
98+
# … but disable documentation and source files when asked to stay slim
99+
if [ "$DOCFILES" = "no" ]; then echo "tlpdbopt_install_docfiles 0" >> install.profile && \
100+
echo "BUILD: Disabling documentation files"; fi && \
101+
if [ "$SRCFILES" = "no" ]; then echo "tlpdbopt_install_srcfiles 0" >> install.profile && \
102+
echo "BUILD: Disabling source files"; fi && \
103+
echo "tlpdbopt_autobackup 0" >> install.profile && \
104+
# furthermore we want our symlinks in the system binary folder to avoid
105+
# fiddling around with the PATH
106+
echo "tlpdbopt_sys_bin /usr/bin" >> install.profile && \
107+
# actually install TeX Live
108+
./install-tl -profile install.profile && \
109+
cd .. && \
110+
rm -rf texlive
111+
112+
WORKDIR /
113+
RUN echo "Set PATH to $PATH" && \
114+
$(find /usr/local/texlive -name tlmgr) path add && \
115+
# Temporary fix for ConTeXt (#30)
116+
(sed -i '/package.loaded\["data-ini"\]/a if os.selfpath then environment.ownbin=lfs.symlinktarget(os.selfpath..io.fileseparator..os.selfname);environment.ownpath=environment.ownbin:match("^.*"..io.fileseparator) else environment.ownpath=kpse.new("luatex"):var_value("SELFAUTOLOC");environment.ownbin=environment.ownpath..io.fileseparator..(arg[-2] or arg[-1] or arg[0] or "luatex"):match("[^"..io.fileseparator.."]*$") end' /usr/bin/mtxrun.lua || true) && \
117+
# pregenerate caches as per #3; overhead is < 5 MB which does not really
118+
# matter for images in the sizes of GBs; some TL schemes might not have
119+
# all the tools, therefore failure is allowed
120+
# make cn great
121+
tlmgr option repository https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/texlive/tlnet && \
122+
if [ "$GENERATE_CACHES" = "yes" ]; then \
123+
echo "Generating caches and ConTeXt files" && \
124+
(luaotfload-tool -u || true) && \
125+
# also generate fontconfig cache as per #18 which is approx. 20 MB but
126+
# benefits XeLaTeX user to load fonts from the TL tree by font name
127+
(cp "$(find /usr/local/texlive -name texlive-fontconfig.conf)" /etc/fonts/conf.d/09-texlive-fonts.conf || true) && \
128+
fc-cache -fsv && \
129+
if [ -f "/usr/bin/context" ]; then \
130+
mtxrun --generate && \
131+
texlua /usr/bin/mtxrun.lua --luatex --generate && \
132+
context --make && \
133+
context --luatex --make; \
134+
fi \
135+
else \
136+
echo "Not generating caches or ConTeXt files"; \
137+
fi
138+
139+
RUN \
140+
# test the installation; we only test the full installation because
141+
# in that, all tools are present and have to work
142+
if [ "$SCHEME" = "full" ]; then \
143+
latex --version && printf '\n' && \
144+
biber --version && printf '\n' && \
145+
xindy --version && printf '\n' && \
146+
arara --version && printf '\n' && \
147+
context --version && printf '\n' && \
148+
context --luatex --version && printf '\n' && \
149+
if [ "$DOCFILES" = "yes" ]; then texdoc -l geometry; fi && \
150+
if [ "$SRCFILES" = "yes" ]; then kpsewhich amsmath.dtx; fi; \
151+
fi && \
152+
python --version && printf '\n' && \
153+
pygmentize -V && printf '\n'

Dockerfile.cn_rolling_release_image

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# FROM texlive_local_build:latest
3+
FROM texlive_local_point_build:latest
4+
5+
RUN tlmgr update --self --all

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Island of TeX / images
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
11
# texlive_docker_cn
2-
a cn version from https://gitlab.com/islandoftex/images/texlive.git
2+
a cn version cloned from https://gitlab.com/islandoftex/images/texlive.git
3+
4+
5+
# Docker TexLive in China on Windows
6+
first build point_release_image, it will use about an hour to download files and create docker images, so it can be treated as a point release imgage. You should rebuild this images only if there is big improvement in TeXLive
7+
8+
second build olling_release_image, it is based on point_release_image and do update, and tag newly built image as `texlive_local_rolling_build:latest`, it must be build-quickly and contain refresh packages.
9+
10+
after rebuild,remeber to delete old image since it's big.
11+
12+
## how to build
13+
14+
```
15+
docker build --platform linux/amd64 -t texlive_local_point_build:latest . -f Dockerfile.cn_point_release_image
16+
17+
18+
docker build --platform linux/amd64 --pull=false -t texlive_local_rolling_build:latest . -f Dockerfile.cn_rolling_release_image
19+
20+
21+
```
22+
23+
## usage
24+
25+
replace command by `wsl docker run ...` in your TeX build-system/text-editor/ide, such as `wsl docker run -i --rm --name latex -v "$PWD":/usr/src/app -w /usr/src/app texlive_local_rolling_build:latest latex -src -interaction=nonstopmode %.tex` instead of `latex -src -interaction=nonstopmode %.tex`.
26+
27+
open `Docker-Desktop`, and do tex job.
28+
29+
30+
31+
32+

debian-cn-mirror.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
3+
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
4+
5+
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
6+
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
7+
8+
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
9+
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
10+
11+
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
12+
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
13+
14+
# deb http://security.debian.org/debian-security bullseye-security main contrib non-free
15+
# deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

0 commit comments

Comments
 (0)