-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitpod.Dockerfile
217 lines (187 loc) · 6.06 KB
/
.gitpod.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
207
208
209
210
211
212
213
214
215
216
FROM gitpod/workspace-full
# Install custom tools, runtime, etc.
RUN sudo apt-get update \
&& sudo apt-get install -y \
&& sudo rm -rf /var/lib/apt/lists/*
RUN npm install --global npm pnpm @teambit/bvm && \
bvm install
# Apply user-specific settings
ENV PATH "${PATH}:${HOME}/bin"
## Pandoc Toolchain
# Proxy to APT cacher: e.g. http://apt-cacher-ng.docker:3142
ARG APT_CACHER
# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
#
# Setup pandoc toolchain
#
USER root
RUN set -x && \
# Setup a cacher to speed up build
if [ -n "${APT_CACHER}" ] ; then \
echo "Acquire::http::Proxy \"${APT_CACHER}\";" | tee /etc/apt/apt.conf.d/01proxy ; \
fi; \
apt-get -qq update && \
apt-get -qy install --no-install-recommends \
# 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 \
# panflute requirements
python3-pip \
python3-setuptools \
python3-wheel \
python3-yaml \
# required for PDF meta analysis
poppler-utils \
zlibc \
# svg conversion
librsvg2-bin \
# clean up
&& apt-get clean && \
rm -rf /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy
#
# Set Locale for UTF-8 support
# This is needed for panflute filters see :
# https://github.com/dalibo/pandocker/pull/86
#
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
#
# SSH pre-config / useful for Gitlab CI
#
RUN mkdir -p ~/.ssh && \
/bin/echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config # See Issue #87
#
# Add local cache/. It's empty by default so this does not change the final
# image on Docker Hub.
#
# However, once warmed with make warm-cache, it can save a lots of bandwidth.
#
ADD cache/ ./cache
#
# Install pandoc from upstream. Debian package is too old.
#
# When incrementing this version, also increment
# PANDOC_CROSSREF_VERSION below.
ARG PANDOC_VERSION=2.14.1
ADD scripts/fetch-pandoc.sh /usr/local/bin/
RUN fetch-pandoc.sh ${PANDOC_VERSION} ./cache/pandoc.deb && \
dpkg --install ./cache/pandoc.deb && \
rm -f ./cache/pandoc.deb
##
## R E V E A L J S
##
#
# The easiest 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
#
ADD requirements.txt ./
RUN pip3 --no-cache-dir install --find-links file://${PWD}/cache -r requirements.txt
#
# pandoc-crossref
#
# This version must correspond to the correct PANDOC_VERSION.
# See https://github.com/lierdakil/pandoc-crossref/releases to find the latest
# release corresponding to the desired pandoc version.
ARG CROSSREF_REPO=https://github.com/lierdakil/pandoc-crossref/releases/download/
ARG CROSSREF_VERSION=0.3.12.0b
RUN wget ${CROSSREF_REPO}/v${CROSSREF_VERSION}/pandoc-crossref-Linux.tar.xz -O /tmp/pandoc-crossref.tar.xz && \
tar xf /tmp/pandoc-crossref.tar.xz && \
install pandoc-crossref /usr/local/bin/ && \
install -d /usr/local/man/man1 && \
install pandoc-crossref.1 /usr/local/man/man1/
##
## T E M P L A T E S
##
# If docker is run with the `--user` option, the $HOME var
# is empty when the user does not exist inside the container.
# This causes several problems for pandoc and xelatex/pdftex.
# We solve the issue by putting the pandoc templates and the
# latex packages in shared spaces (TEXMFLOCAL, TEMPLATES_DIR)
# and creating symbolic links inside the `/root` home so that
# the templates and packages can be accessed by root and a
# non-existent `--user`
#
# See Bug #110 : https://github.com/dalibo/pandocker/issues/110
#
# CTAM packages are installed in the system-wide latex tree
# See `kpsewhich -var-value=TEXMFLOCAL`
ENV TEXMFLOCAL=/usr/local/share/texmf
# Templates are installed in '/.pandoc'.
ARG TEMPLATES_DIR=/.pandoc/templates
RUN mkdir -p ${TEMPLATES_DIR} && \
mkdir /.texlive2016 && \
# Links for the non-existent
ln -s ${TEXMFLOCAL} /texmf && \
# Links for the root user
ln -s /.pandoc /root/.pandoc && \
ln -s ${TEXMFLOCAL} /root/texmf && \
ln -s /.texlive2016 /root/.texlive2016
# eisvogel template
# USER gitpod
# ARG EISVOGEL_REPO=https://raw.githubusercontent.com/Wandmalfarbe/pandoc-latex-template
# ARG EISVOGEL_VERSION=2.0.0
# RUN wget ${EISVOGEL_REPO}/v${EISVOGEL_VERSION}/eisvogel.tex -O ${TEMPLATES_DIR}/eisvogel.latex
# RUN tlmgr init-usertree && \
# # Debian/buster comes with TL2018, and thus refuses to work with the 2020 repositories, even in self mode
# tlmgr option repository ftp://tug.org/historic/systems/texlive/2020/tlnet-final && \
# # tlmgr option repository ftp://tug.org/texlive/tlcritical && \
# tlmgr install fontawesome5 awesomebox ly1 inconsolata sourcesanspro sourcecodepro mweights || \
# # This first call returns an error but the packages are installed,
# # we call it again to check that everything is fine
# tlmgr install fontawesome5 awesomebox ly1 inconsolata sourcesanspro sourcecodepro mweights && \
# # update the font map
# updmap-sys
# letter template
ARG LETTER_REPO=https://raw.githubusercontent.com/aaronwolen/pandoc-letter
ARG LETTER_VERSION=master
RUN wget ${LETTER_REPO}/${LETTER_VERSION}/template-letter.tex -O ${TEMPLATES_DIR}/letter.latex
# leaflet template
ARG LEAFLET_REPO=https://gitlab.com/daamien/pandoc-leaflet-template/raw
ARG LEAFLET_VERSION=1.0
RUN wget ${LEAFLET_REPO}/${LEAFLET_VERSION}/leaflet.latex -O ${TEMPLATES_DIR}/leaflet.latex