-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.kerneldoc-sarasa-focal
78 lines (78 loc) · 2.96 KB
/
Dockerfile.kerneldoc-sarasa-focal
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
# Recent Tex Live/Debian package lacks dependency of
# texlive-xetex -> texlive-lang-chinese, or xecjk -> ctex since June 2020.
# ARG variables: ink, img, rsvg
# Defaults are: ink=1 img=0 rsvg=0
# Note:
# On Debian based distros, convert(1) does not have its own SVG renderer.
FROM ubuntu:focal
RUN apt-get update && apt-get upgrade -y && apt-get install -y locales && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/*
ENV LANG en_US.utf8
RUN apt-get update && DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y tzdata && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y perl-modules \
fonts-dejavu fonts-texgyre fonts-noto-cjk fonts-liberation \
make && \
apt-get install -y --no-install-recommends texlive-lang-chinese \
texlive-xetex texlive-fonts-recommended tex-gyre graphviz dvipng \
python3-venv latexmk && \
rm -rf /var/lib/apt/lists/*
RUN cd /usr/local/share/texmf && \
mkdir fonts && cd fonts && \
mv /usr/share/fonts/type1/urw-base35/*.t1 . && \
mv /usr/share/fonts/opentype/urw-base35/StandardSymbolsPS.otf . && \
mv /usr/share/fonts/type1/texlive-fonts-recommended/*.pfb . && \
mv /usr/share/fonts/X11/Type1/*.pfb . && \
fc-cache -s
ARG ink=1
RUN if [ $ink -ne 0 ] ; then \
apt-get update && \
apt-get install -y --no-install-recommends inkscape && \
rm -rf /var/lib/apt/lists/* ; \
fi
ARG img=0
RUN if [ $img -ne 0 ] ; then \
apt-get update && \
apt-get install -y --no-install-recommends imagemagick && \
rm -rf /var/lib/apt/lists/* && \
cd /etc/ImageMagick-6 && sed -i 's+policy domain="coder" rights="none" pattern="PDF"+policy domain="coder" rights="read|write" pattern="PDF"+' policy.xml ; \
fi
ARG rsvg=0
RUN if [ $rsvg -ne 0 ] ; then \
apt-get update && \
apt-get install -y --no-install-recommends librsvg2-bin && \
rm -rf /var/lib/apt/lists/* ; \
fi
COPY sarasa-mono-k-regular.ttf sarasa-mono-k-bold.ttf sarasa-mono-k-italic.ttf sarasa-mono-k-bolditalic.ttf /usr/local/share/fonts/
RUN fc-cache /usr/local/share/fonts/
COPY requirements.txt requirements-1.7.9.txt requirements-latest.txt /opt/
ARG uid=0
ARG gid=0
ARG user=kerneldoc
ARG group=kerneldoc
RUN if [ $uid -ne 0 ] ; then \
groupadd -g $gid $group ; \
useradd -u $uid -g $gid -m $user ; \
fi
USER $uid:$gid
WORKDIR /home/kerneldoc
RUN /usr/bin/python3 -m venv sphinx_2.4.4 && \
. sphinx_2.4.4/bin/activate && \
pip install --upgrade pip && \
pip install -r /opt/requirements.txt && \
deactivate
RUN /usr/bin/python3 -m venv sphinx_1.7.9 && \
. sphinx_1.7.9/bin/activate && \
pip install --upgrade pip && \
pip install -r /opt/requirements-1.7.9.txt && \
deactivate
RUN /usr/bin/python3 -m venv sphinx_latest && \
. sphinx_latest/bin/activate && \
pip install --upgrade pip && \
pip install -r /opt/requirements-latest.txt && \
deactivate
VOLUME /work
WORKDIR /work
CMD /bin/bash