-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
69 lines (60 loc) · 1.77 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
# https://hub.docker.com/r/portown/alpine-pandoc/~/dockerfile/
#
# We use:
# * Pandoc (Haskell) to convert all Markdown into either generated HTML or .rst files.
# * PlantUML (Java) to convert UML diagrams to SVG images.
#
FROM alpine:3.10
ENV BUILD_DEPS \
alpine-sdk \
cabal \
coreutils \
ghc \
libffi \
musl-dev \
zlib-dev
ENV PERSISTENT_DEPS \
gmp \
graphviz \
openjdk11-jre \
python \
py2-pip \
sed \
ttf-droid \
ttf-droid-nonlatin
ENV PLANTUML_VERSION 1.2019.8
ENV PLANTUML_DOWNLOAD_URL https://sourceforge.net/projects/plantuml/files/plantuml.$PLANTUML_VERSION.jar/download
ENV PANDOC_VERSION 2.7.3
ENV PANDOC_DOWNLOAD_URL https://hackage.haskell.org/package/pandoc-$PANDOC_VERSION/pandoc-$PANDOC_VERSION.tar.gz
ENV PANDOC_ROOT /usr/local/pandoc
ENV PATH $PATH:$PANDOC_ROOT/bin
# Install/Build Packages
RUN apk upgrade --update && \
apk add --virtual .build-deps $BUILD_DEPS && \
apk add --virtual .persistent-deps $PERSISTENT_DEPS && \
curl -fsSL "$PLANTUML_DOWNLOAD_URL" -o /usr/local/plantuml.jar && \
chmod a+r /usr/local/plantuml.jar && \
mkdir -p /pandoc-build \
/var/docs && \
cd /pandoc-build && \
curl -fsSL "$PANDOC_DOWNLOAD_URL" | tar -xzf - && \
cd pandoc-$PANDOC_VERSION && \
cabal update && \
cabal install --only-dependencies && \
cabal configure --prefix=$PANDOC_ROOT && \
cabal build && \
cabal copy && \
cd / && \
rm -Rf /pandoc-build \
$PANDOC_ROOT/lib \
/root/.cabal \
/root/.ghc && \
set -x && \
addgroup -g 82 -S pandoc && \
adduser -u 82 -D -S -G pandoc pandoc && \
apk del .build-deps
COPY plantuml /usr/local/bin/
# Set to non root user
USER pandoc
# Reset the work dir
WORKDIR /var/docs