git.iko.soy/typeable/pandoc
on master help sign in
Added static-linux directory.

This provides a Makefile and Dockerfile sufficient for producing a completely statically linked linux executable for maximum portability. If docker is installed, this should suffice: make setup make build The binary will be placed in artifacts/.

commit63c96f8b91b26f4c12a48ea30f330d689b4c67fa authorJohn MacFarlane <jgm@berkeley.edu> dateFri 17 Mar 2017, 14:17 (10 years ago) parent090165d
2 files changed+29
static-linux/Dockerfile+18 static-linux/Makefile+11
static-linux/Dockerfilenew file+18
@@ -0,0 +1,18 @@
1+# USE ALPINE LINUX
2+FROM alpine:edge
3+RUN apk update
4+# INSTALL BASIC DEV TOOLS, GHC, GMP & ZLIB
5+RUN echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/8.0" >> /etc/apk/repositories
6+ADD https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%40gmail.com-55881c97.rsa.pub \
7+ /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub
8+RUN apk update
9+RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev
10+RUN stack update
11+RUN stack config set system-ghc --global true
12+ADD ./ /usr/src/
13+WORKDIR /usr/src/
14+RUN git clone https://github.com/jgm/pandoc
15+WORKDIR /usr/src/pandoc
16+CMD git pull
17+CMD stack install --local-bin-path /usr/bin hsb2hs
18+CMD stack install --local-bin-path /artifacts --flag 'pandoc:embed_data_files' --test --ghc-options '-optl-static -fPIC'
static-linux/Makefilenew file+11
@@ -0,0 +1,11 @@
1+ARTIFACTS=`pwd`/artifacts
2+
3+build:
4+ mkdir -p $(ARTIFACTS)
5+ docker run -v $(ARTIFACTS):/artifacts alpine-pandoc
6+
7+setup:
8+ docker pull alpine:edge
9+ docker build -t alpine-pandoc .
10+
11+.PHONY: build setup