git.iko.soy/typeable/pandoc
on 175da00 help sign in
31 lines 1.3 kB history raw
1# USE ALPINE LINUX
2FROM alpine
3RUN apk update
4RUN apk add alpine-sdk git ca-certificates ghc gmp-dev zlib-dev bash dpkg fakeroot
5# GRAB A RECENT BINARY OF STACK
6# Note that 1.6.5 is the last one with a static binary...
7RUN curl -L https://github.com/commercialhaskell/stack/releases/download/v1.6.5/stack-1.6.5-linux-x86_64-static.tar.gz | tar xz --wildcards --strip-components=1 -C /usr/local/bin '*/stack'
8# COMPRESS WITH UPX
9ADD https://github.com/lalyos/docker-upx/releases/download/v3.91/upx /usr/local/bin/upx
10ENV PATH="/usr/local/bin:${PATH}"
11RUN chmod 755 /usr/local/bin/upx
12RUN ulimit -n 4096
13RUN stack config set system-ghc --global true
14RUN stack setup --resolver lts-12
15RUN mkdir -p /usr/src/
16WORKDIR /usr/src/
17RUN git clone https://github.com/jgm/pandoc
18WORKDIR /usr/src/pandoc
19CMD git pull && \
20 git checkout -b work $TREE && \
21 stack install \
22 --flag 'pandoc:static' \
23 --flag 'pandoc:embed_data_files' \
24 --flag 'pandoc-citeproc:static' \
25 --flag 'pandoc-citeproc:embed_data_files' \
26 --flag 'hslua:-export-dynamic' \
27 --ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
28 --local-bin-path /artifacts \
29 pandoc pandoc-citeproc && \
30 bash linux/make_deb.sh && \
31 bash linux/make_tarball.sh