Skip to content

Commit 7aeefa7

Browse files
committed
Bookworm: first draft
1 parent 03b4240 commit 7aeefa7

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

3.5/bookworm/Dockerfile

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Base ##################################################################
2+
FROM debian:bookworm AS debian-minimal
3+
ARG PANDOC=3.5
4+
ARG LUA=5.4
5+
6+
LABEL maintainer='Albert Krewinkel <[email protected]>'
7+
LABEL org.pandoc.maintainer='Albert Krewinkel <[email protected]>'
8+
LABEL org.pandoc.author "John MacFarlane"
9+
LABEL org.pandoc.version "$pandoc_version"
10+
11+
# Install runtime dependencies
12+
RUN <<EOF
13+
set -eux
14+
apt-get -q --no-allow-insecure-repositories update
15+
DEBIAN_FRONTEND=noninteractive \
16+
apt-get install --assume-yes --no-install-recommends \
17+
ca-certificates \
18+
liblua$LUA-0 \
19+
libatomic1 \
20+
libgmp10 \
21+
libpcre3 \
22+
libyaml-0-2 \
23+
zlib1g
24+
rm -rf /var/lib/apt/lists/*
25+
EOF
26+
27+
RUN <<EOF
28+
set -eux
29+
cd /tmp
30+
apt-get -q --no-allow-insecure-repositories update
31+
# Install build dependencies
32+
DEBIAN_FRONTEND=noninteractive \
33+
apt-get install --assume-yes --no-install-recommends \
34+
build-essential \
35+
ca-certificates \
36+
cabal-install \
37+
curl \
38+
fakeroot \
39+
git \
40+
ghc \
41+
libgmp-dev \
42+
liblua$LUA-dev \
43+
pkg-config \
44+
zlib1g-dev
45+
EOF
46+
47+
RUN <<EOF
48+
set -eux; \
49+
# Get pandoc-cli sources
50+
cabal update
51+
cabal get pandoc-cli-${PANDOC}
52+
cd pandoc-cli-${PANDOC}
53+
54+
# Setup to include pandoc-crossref
55+
printf 'packages: pandoc-cli.cabal\n' > cabal.project
56+
# Add pandoc-crossref to project
57+
printf 'extra-packages: pandoc-crossref\n' >> cabal.project
58+
cat cabal.project
59+
EOF
60+
61+
RUN <<EOF
62+
set -eux
63+
cd pandoc-cli-${PANDOC}
64+
# Build and install
65+
cabal install pandoc-cli:exes pandoc-crossref:exes \
66+
--jobs \
67+
--disable-tests \
68+
--disable-bench \
69+
--allow-newer='lib:pandoc' \
70+
--prefix=/usr \
71+
--docdir=/usr/share/doc/pandoc \
72+
--flags='+server +lua' \
73+
--sysconfdir=/etc \
74+
--ghc-options='-O1 -optc-Os -optl=-pthread -fPIC -j +RTS -A128m -n2m -RTS'
75+
76+
EOF
77+
78+
RUN <<EOF
79+
set -eux
80+
cd pandoc-cli-${PANDOC}
81+
cabal list-bin pandoc-cli:exes | xargs install -Dm755 -t /usr/bin
82+
#
83+
find /root/.cabal \
84+
-name 'pandoc*' -type f -perm -u+x \
85+
-exec strip '{}' ';' \
86+
-exec cp '{}' /usr/local/bin/ ';'
87+
88+
# cd /
89+
# ls -l -d /root/.*
90+
# rm -rf /root/.cabal /root/.ghc
91+
# rm -rf /tmp/*
92+
# rm -rf /var/lib/apt/lists/*
93+
EOF

0 commit comments

Comments
 (0)