@@ -1,12 +1,11 @@
11# USE ALPINE LINUX
22FROM alpine:edge
3−RUN apk update
4−# INSTALL BASIC DEV TOOLS, GHC, GMP & ZLIB
53RUN echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/8.0" >> /etc/apk/repositories
64ADD https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%40gmail.com-55881c97.rsa.pub \
75 /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub
86RUN apk update
9−RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev
7+RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev \
8+ dpkg fakeroot sed gawk grep
109RUN stack update
1110RUN stack config set system-ghc --global true
1211RUN mkdir -p /etc/stack
@@ -16,6 +15,18 @@ WORKDIR /usr/src/
1615RUN git clone https://github.com/jgm/pandoc
1716WORKDIR /usr/src/pandoc
1817RUN stack install --local-bin-path /usr/bin hsb2hs
19−RUN stack install --only-dependencies --flag 'pandoc:embed_data_files' --test --ghc-options '-O2 -optc-Os -optl-static -fPIC'
20−CMD git pull
21−CMD stack install --local-bin-path /artifacts --flag 'pandoc:embed_data_files' --test --ghc-options '-O2 -optc-Os -optl-static -fPIC'
18+RUN stack install --stack-yaml stack.pkg.yaml --only-dependencies \
19+ --flag 'pandoc:embed_data_files' \
20+ --test --ghc-options '-O2 -optc-Os -optl-static -fPIC' \
21+ pandoc pandoc-citeproc
22+CMD git pull && \
23+ export VERSION=`grep '^Version:' pandoc.cabal | awk '{print $$2;}'` && \
24+ stack install --stack-yaml stack.pkg.yaml \
25+ --local-bin-path /artifacts --flag 'pandoc:embed_data_files' \
26+ --test --ghc-options '-O2 -optc-Os -optl-static -fPIC' \
27+ pandoc pandoc-citeproc && \
28+ cd /artifacts && \
29+ mkdir pandoc-$VERSION && \
30+ mv pandoc pandoc-citeproc pandoc-$VERSION/ && \
31+ tar cvzf pandoc-$VERSION.tgz pandoc-$VERSION && \
32+ rm -r pandoc-$VERSION