-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.kerneldoc-gentoo
43 lines (43 loc) · 1.86 KB
/
Dockerfile.kerneldoc-gentoo
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
# Note:
# This will build an image of almost 4 GiB, with the build time
# of a few hours or more (depending on the system performance)!
FROM gentoo/stage3:latest
RUN emerge --sync
# Workaround to build error
# Hinted at: https://forums.gentoo.org/viewtopic-t-1125304-start-0.html
ENV FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -sandbox -usersandbox"
RUN echo 'USE="X -gtk -gnome -alsa truetype svg xml png xetex icu fontconfig"' >> /etc/portage/make.conf && \
echo "media-gfx/imagemagick pango q8" > /etc/portage/package.use/imagemagick && \
echo "media-gfx/graphviz cairo pdf" > /etc/portage/package.use/graphviz && \
echo "app-text/texlive-core cjk" > /etc/portage/package.use/texlive-langchinese && \
echo "app-text/poppler cairo" > /etc/portage/package.use/inkscape
RUN emerge media-gfx/inkscape media-gfx/graphviz media-gfx/imagemagick latexmk \
media-fonts/dejavu media-fonts/noto-cjk emerge dev-texlive/texlive-xetex \
dev-texlive/texlive-langchinese && \
rm -f /var/cache/distfiles/*
# Permit PDF output in Imagemagick's policy
RUN cd /etc/ImageMagick-7 && sed -i 's+policy domain="coder" rights="none" pattern="PDF"+policy domain="coder" rights="read|write" pattern="PDF"+' policy.xml
COPY requirements.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_latest && \
. sphinx_latest/bin/activate && \
pip install --upgrade pip && \
pip install -r /opt/requirements-latest.txt && \
deactivate
VOLUME /work
WORKDIR /work
CMD /bin/bash