Skip to content

Commit 6541075

Browse files
committed
add in a Dockerfile to build linux binaries
Based on https://gist.github.com/rlefevre/1523f47e75310e28eee243c9c5651ac9 by @rlefevre. Thank you so much!
1 parent 0198a19 commit 6541075

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

installers/linux/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM alpine:3.10
2+
3+
# branch
4+
ARG branch=master
5+
# commit or tag
6+
ARG commit=HEAD
7+
8+
# Install required packages
9+
RUN apk add --update ghc cabal git musl-dev zlib-dev ncurses-dev ncurses-static wget
10+
11+
# Checkout elm compiler
12+
WORKDIR /tmp
13+
RUN git clone -b $branch https://github.com/elm/compiler.git
14+
15+
# Build a statically linked elm binary
16+
WORKDIR /tmp/compiler
17+
RUN git checkout $commit
18+
RUN rm worker/elm.cabal
19+
RUN cabal new-update
20+
RUN cabal new-configure --disable-executable-dynamic --ghc-option=-optl=-static --ghc-option=-optl=-pthread
21+
RUN cabal new-build
22+
RUN strip -s ./dist-newstyle/build/x86_64-linux/ghc-8.4.3/elm-0.19.1/x/elm/build/elm/elm

0 commit comments

Comments
 (0)