2017-10-23 00:04:49 +02:00
|
|
|
# USE ALPINE LINUX
|
2018-04-24 07:43:10 +02:00
|
|
|
FROM alpine
|
|
|
|
RUN apk update
|
|
|
|
# INSTALL BASIC DEV TOOLS, GHC, GMP & ZLIB
|
2017-10-23 00:04:49 +02:00
|
|
|
RUN echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/8.0" >> /etc/apk/repositories
|
|
|
|
ADD https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%40gmail.com-55881c97.rsa.pub \
|
|
|
|
/etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub
|
|
|
|
RUN apk update
|
2018-04-24 07:43:10 +02:00
|
|
|
RUN apk add alpine-sdk git ca-certificates ghc gmp-dev zlib-dev bash dpkg fakeroot
|
|
|
|
# GRAB A RECENT BINARY OF STACK
|
2018-05-11 20:46:39 +02:00
|
|
|
RUN 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'
|
2018-04-24 07:43:10 +02:00
|
|
|
# COMPRESS WITH UPX
|
|
|
|
ADD https://github.com/lalyos/docker-upx/releases/download/v3.91/upx /usr/local/bin/upx
|
2018-05-11 20:46:39 +02:00
|
|
|
ENV PATH="/usr/local/bin:${PATH}"
|
2018-04-24 07:43:10 +02:00
|
|
|
RUN chmod 755 /usr/local/bin/upx
|
|
|
|
RUN ulimit -n 4096
|
2017-12-28 18:25:01 +01:00
|
|
|
RUN stack config set system-ghc --global true
|
2018-04-24 19:53:08 +02:00
|
|
|
RUN stack --resolver lts-9 setup --install-cabal 2.0.1.1
|
2017-10-23 00:04:49 +02:00
|
|
|
#RUN mkdir -p /etc/stack
|
2017-10-22 23:29:20 +02:00
|
|
|
#RUN echo "build: { split-objs: true }" > /etc/stack/config.yaml
|
2017-03-19 16:24:52 +01:00
|
|
|
RUN mkdir -p /usr/src/
|
|
|
|
WORKDIR /usr/src/
|
2018-04-24 07:43:10 +02:00
|
|
|
RUN git clone https://github.com/jgm/pandoc
|
2017-03-19 16:24:52 +01:00
|
|
|
WORKDIR /usr/src/pandoc
|
2017-12-28 18:25:01 +01:00
|
|
|
RUN stack install --stack-yaml stack.lts9.yaml \
|
|
|
|
--only-dependencies \
|
|
|
|
--flag 'pandoc:static' \
|
|
|
|
--flag 'pandoc:embed_data_files' \
|
|
|
|
--flag 'pandoc-citeproc:static' \
|
|
|
|
--flag 'pandoc-citeproc:embed_data_files' \
|
|
|
|
--flag 'hslua:-export-dynamic' \
|
|
|
|
--ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
|
|
|
|
aeson
|
|
|
|
RUN stack install --stack-yaml stack.lts9.yaml \
|
|
|
|
--only-dependencies \
|
|
|
|
--flag 'pandoc:static' \
|
|
|
|
--flag 'pandoc:embed_data_files' \
|
|
|
|
--flag 'pandoc-citeproc:static' \
|
|
|
|
--flag 'pandoc-citeproc:embed_data_files' \
|
|
|
|
--flag 'hslua:-export-dynamic' \
|
|
|
|
--ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
|
|
|
|
http-client-tls
|
|
|
|
RUN stack install --stack-yaml stack.lts9.yaml \
|
2017-12-28 05:55:15 +01:00
|
|
|
--only-dependencies \
|
2017-10-30 22:28:21 +01:00
|
|
|
--flag 'pandoc:static' \
|
2017-03-19 16:24:52 +01:00
|
|
|
--flag 'pandoc:embed_data_files' \
|
2017-10-30 22:28:21 +01:00
|
|
|
--flag 'pandoc-citeproc:static' \
|
|
|
|
--flag 'pandoc-citeproc:embed_data_files' \
|
|
|
|
--flag 'hslua:-export-dynamic' \
|
2017-10-23 00:04:49 +02:00
|
|
|
--ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
|
2017-03-19 16:24:52 +01:00
|
|
|
pandoc pandoc-citeproc
|
|
|
|
CMD git pull && \
|
|
|
|
git checkout -b work $TREE && \
|
2017-12-28 18:25:01 +01:00
|
|
|
stack install --stack-yaml stack.lts9.yaml \
|
2017-10-23 00:04:49 +02:00
|
|
|
--flag 'pandoc:static' \
|
|
|
|
--flag 'pandoc:embed_data_files' \
|
2017-10-30 22:28:21 +01:00
|
|
|
--flag 'pandoc-citeproc:static' \
|
|
|
|
--flag 'pandoc-citeproc:embed_data_files' \
|
2017-10-23 00:04:49 +02:00
|
|
|
--flag 'hslua:-export-dynamic' \
|
|
|
|
--ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
|
|
|
|
--local-bin-path /artifacts \
|
|
|
|
pandoc pandoc-citeproc && \
|
|
|
|
bash linux/make_deb.sh && \
|
|
|
|
bash linux/make_tarball.sh
|