Created
April 2, 2019 07:40
-
-
Save docteurklein/bc17f4a967ee961652698075f0ee1ec8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:edge as build | |
RUN apk add --no-cache ghc musl-dev | |
RUN wget https://github.com/commercialhaskell/stack/releases/download/v1.9.0.1/stack-1.9.0.1-linux-x86_64-static.tar.gz -O - \ | |
| tar -Oxzf - stack-1.9.0.1-linux-x86_64-static/stack > /usr/bin/stack | |
RUN chmod +x /usr/bin/stack | |
WORKDIR /usr/src/app | |
RUN adduser -D -u 1000 build | |
RUN chown build:build . | |
USER build | |
RUN stack config set system-ghc --global true | |
COPY --chown=build . . | |
RUN stack build --ghc-options='-optl-static -optl-pthread' --force-dirty | |
FROM scratch | |
USER 1000 | |
COPY --from=build /usr/src/app/.stack-work/install/x86_64-linux/lts-12.12/8.4.3/bin/test-exe /usr/local/bin/ | |
ENTRYPOINT ["/usr/local/bin/test-exe"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment