-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
206 lines (179 loc) · 4.92 KB
/
Dockerfile
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#
# STAGE 1: extra variant
#
FROM pandoc/extra:3.2-ubuntu as extra
# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
#
# Ubuntu packages
#
RUN set -x && \
apt-get -qq update && \
apt-get -qy install --no-install-recommends \
# for pandoc filters
python-is-python3 \
# for deployment
openssh-client \
rsync \
# for locales and utf-8 support
locales \
# latex toolchain
ghostscript \
lmodern \
texlive \
texlive-lang-french \
texlive-lang-german \
texlive-lang-european \
texlive-lang-spanish \
texlive-luatex \
texlive-pstricks \
texlive-xetex \
xzdec \
# reveal (see issue #18)
netbase \
# fonts
fonts-dejavu \
fonts-font-awesome \
fonts-lato \
fonts-liberation \
# build tools
make \
git \
parallel \
wget \
unzip \
# required for PDF meta analysis
poppler-utils \
# clean up
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*
#
# Set Locale for UTF-8 support
# This is needed for panflute filters see :
# https://github.com/dalibo/pandocker/pull/86
#
RUN locale-gen C.UTF-8
ENV LANG C.UTF-8
#
# SSH pre-config / useful for Gitlab CI
# See Issue #87
#
RUN mkdir -p ~/.ssh && \
/bin/echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
##
## R E V E A L J S
##
#
# The easiest way to produce reveal slides is to point to a CDN like this:
#
# -V revealjs-url=https://unpkg.com/reveal.js
#
# However it's useful to have revealjs inside pandocker when you want
# to build offline
#
# pandoc 2.10+ requires revealjs 4.x
ARG REVEALJS_VERSION=4.1.2
RUN wget https://github.com/hakimel/reveal.js/archive/${REVEALJS_VERSION}.tar.gz -O revealjs.tar.gz && \
tar -xzvf revealjs.tar.gz && \
cp -r reveal.js-${REVEALJS_VERSION}/dist / && \
cp -r reveal.js-${REVEALJS_VERSION}/plugin /
##
## F I L T E R S
##
# Python filters
# The option `--break-system-packages` sounds bad but this is not
# really a problem here because we are not using Python debian packages
# anyway.
ADD requirements.txt ./
RUN pip3 --no-cache-dir install -r requirements.txt --break-system-packages
# Lua filters
ARG PANDA_REPO=https://github.com/CDSoft/panda.git
ARG PANDA_VERSION=8dcbe68
RUN git clone ${PANDA_REPO} /tmp/panda && \
cd /tmp/panda && \
git checkout ${PANDA_VERSION} && \
make install && \
rm -fr /tmp/panda
##
## L A T E X
##
ADD packages.txt ./
RUN tlmgr init-usertree && \
tlmgr install `echo $(grep -v '^#' packages.txt )` && \
# update the font map
updmap-sys
##
##
## T E M P L A T E S
##
# Templates are installed in '/.pandoc'.
ARG TEMPLATES_DIR=/.pandoc/templates
# Starting with 24.04, there's a user named `ubuntu` with id=1000
# If docker is run with the `--user 1000` option and $HOME for pandoc
# will be `/home/ubuntu`
RUN ln -s /.pandoc /home/ubuntu/.pandoc
# Easy templates
ARG EASY_REPO=https://raw.githubusercontent.com/ryangrose/easy-pandoc-templates/
ARG EASY_VERSION=9a884190fe19782f4434851053947173f8cec3d2
RUN wget ${EASY_REPO}/${EASY_VERSION}/html/uikit.html -O ${TEMPLATES_DIR}/uikit.html && \
wget ${EASY_REPO}/${EASY_VERSION}/html/bootstrap_menu.html -O ${TEMPLATES_DIR}/bootstrap_menu.html && \
wget ${EASY_REPO}/${EASY_VERSION}/html/clean_menu.html -O ${TEMPLATES_DIR}/clean_menu.html && \
wget ${EASY_REPO}/${EASY_VERSION}/html/easy_template.html -O ${TEMPLATES_DIR}/easy_template.html && \
wget ${EASY_REPO}/${EASY_VERSION}/html/elegant_bootstrap_menu.html -O ${TEMPLATES_DIR}/elegant_bootstrap_menu.html
##
## E N D
##
VOLUME /pandoc
WORKDIR /pandoc
ENTRYPOINT ["pandoc"]
#
# STAGE 2: full variant
#
FROM extra as full
# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
#
# Debian
#
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x && \
apt-get -qq update && \
apt-get -qy install --no-install-recommends \
#
texlive-lang-other \
# hindi fonts
fonts-deva \
# persian fonts
texlive-lang-arabic \
fonts-farsiweb \
# dia
dia \
# Noto font families with large Unicode coverage
fonts-noto \
fonts-noto-cjk \
fonts-noto-cjk-extra \
fonts-noto-color-emoji \
fonts-noto-core \
fonts-noto-extra \
fonts-noto-mono \
# clean up
&& apt-get clean && \
rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy
##
## L A T E X
##
ADD packages.full.txt ./
# The TexLive user mode database already set up; no need to run `tlmgr init-tree`
RUN tlmgr install `echo $(grep -v '^#' packages.full.txt )` && \
# update the font map
updmap-sys
##
## E N T R Y P O I N T
##
VOLUME /pandoc
WORKDIR /pandoc
ENTRYPOINT ["pandoc"]