-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.kerneldoc-alpine
64 lines (64 loc) · 2.59 KB
/
Dockerfile.kerneldoc-alpine
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
FROM alpine:latest
# ARG variable example use:
# --build-arg ink=0 --build-arg img=1
#
# Defaults are:
# ink=1 img=0
# librsvg is required by imagemagick-libs or ???
# Note:
# xdvipdfmx can't handle translations.xdv on alpine:3.14 and later
# For the moment, not having font-noto-cjk and skipping CJK chapters
# looks like a reasonable compromise avoiding error in "make pdfdocs".
# See Dockerfile.kerneldoc-alpine-glibc for a glibc based approach,
# but be warned that it is only a happens-to-work thing.
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 TEXLIVE_INSTALL_NO_CONTEXT_CACHE=1 NOPERLDOC=1
RUN apk -U add --no-cache make graphviz \
perl python3 wget \
ca-certificates bash grep sed \
coreutils ttf-liberation ttf-dejavu
COPY texlive.profile /opt/texlive.profile
WORKDIR /opt
# Alternatives of tlrepo in or near JP
# https://ftp.jaist.ac.jp/pub/CTAN/systems/texlive/tlnet
# https://ftp.yz.yamagata-u.ac.jp/pub/CTAN/systems/texlive/tlnet
ARG tlrepo=https://mirror.ctan.org/systems/texlive/tlnet
RUN wget $tlrepo/install-tl-unx.tar.gz && \
tar xf install-tl-unx.tar.gz && rm -rf *.tar.gz && cd install-tl-* && \
perl install-tl -profile /opt/texlive.profile -repository $tlrepo && \
cd /opt && \
find /usr/local/texlive/2021/texmf-var/ -name "*.log" -exec rm \{\} +
ENV PATH=/usr/local/bin:/usr/local/texlive/2021/bin/x86_64-linuxmusl:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
# Remove unused large font packages after the fact:
# arphic, fandol, fonts-tlwg, tipa, uhc, wadalab
RUN tlmgr --repository $tlrepo install \
babel babel-english \
anyfontsize capt-of cmap eqparbox fancybox fncychap fancyhdr framed \
mdwtools multirow needspace parskip tabulary threeparttable ucs upquote \
wrapfig ctex latexmk varwidth titlesec \
fancyvrb float setspace tex-gyre oberdiek dvipng && \
tlmgr remove --force arphic fandol fonts-tlwg tipa uhc wadalab && \
find /usr/local/texlive/2021/texmf-var/ -name "*.log" -exec rm \{\} +
ARG ink=1
RUN if [ $ink -ne 0 ] ; then apk -U add --no-cache inkscape ; \
fi
ARG img=0
RUN if [ $img -ne 0 ] ; then apk -U add --no-cache imagemagick ; \
fi
COPY requirements-latest.txt /opt
ARG uid=0
ARG gid=0
ARG user=kerneldoc
ARG group=kerneldoc
RUN if [ $uid -ne 0 ] ; then addgroup --gid $gid $group ; \
adduser --uid $uid --ingroup $group --disabled-password $user ; \
fi
USER $uid:$gid
WORKDIR /home/kerneldoc
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