Revised Dockerfile for static linux build.

This commit is contained in:
John MacFarlane 2018-04-23 22:43:10 -07:00
parent 4ca51ab76c
commit 58534cc74e

View file

@ -1,20 +1,24 @@
# USE ALPINE LINUX
FROM alpine:edge
FROM alpine
RUN apk update
# INSTALL BASIC DEV TOOLS, GHC, GMP & ZLIB
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
RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev \
dpkg fakeroot sed gawk grep bash linux-headers
ENV PATH="/root/.local/bin:${PATH}"
RUN stack update
RUN stack upgrade
RUN apk add alpine-sdk git ca-certificates ghc gmp-dev zlib-dev bash dpkg fakeroot
# GRAB A RECENT BINARY OF STACK
RUN curl -L https://www.stackage.org/stack/linux-x86_64-static | tar xz --wildcards --strip-components=1 -C /usr/local/bin '*/stack'
# COMPRESS WITH UPX
ADD https://github.com/lalyos/docker-upx/releases/download/v3.91/upx /usr/local/bin/upx
RUN chmod 755 /usr/local/bin/upx
RUN ulimit -n 4096
RUN stack config set system-ghc --global true
#RUN mkdir -p /etc/stack
#RUN echo "build: { split-objs: true }" > /etc/stack/config.yaml
RUN mkdir -p /usr/src/
WORKDIR /usr/src/
RUN git clone https://github.com/jgm/pandoc
RUN git clone https://github.com/jgm/pandoc
WORKDIR /usr/src/pandoc
RUN stack install --stack-yaml stack.lts9.yaml \
--only-dependencies \