From 58534cc74edd6b3492367cfe612286ad8301070f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 23 Apr 2018 22:43:10 -0700 Subject: Revised Dockerfile for static linux build. --- linux/Dockerfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'linux') diff --git a/linux/Dockerfile b/linux/Dockerfile index b64908b6b..132e189b9 100644 --- a/linux/Dockerfile +++ b/linux/Dockerfile @@ -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 \ -- cgit v1.2.3