Update docker file to use multistage build
Former-commit-id: f7a8f5ecab5532796ca4462acc1214f5392fb6ae Former-commit-id: 0f85a545eef0467ae1d0129cdf8d992dbbb80072 [formerly 74524eb303c5ac0d8d55fe3219fb867c8104df71] [formerly 262d4dd258888853b8ca2fd24955dd26b4d78701 [formerly 3439945b19ac44d5b06e99bc35aab84155f1c48a [formerly 14d1035d3ec94627c06b8450bf2a582410f48b94] [formerly 14d1035d3ec94627c06b8450bf2a582410f48b94 [formerly 14d1035d3ec94627c06b8450bf2a582410f48b94 [formerly 962f5ddfa909bf4241f29de46a72df64ef3992ec]]]]] Former-commit-id: 73fae6474844a1512bb7eb792058194530175d92 [formerly e5d0dc67369d4f7b277734df6bc69d95cdaae79f] Former-commit-id: 58eacf41730f8f218e2a239d1407fcef512fa95e Former-commit-id: 8ad509aba4c928c1a9c41d98b66e061283a0f460 Former-commit-id: 5a3a90ac30ab3676d63a82e81c3a7e3b459b1a82 Former-commit-id: 24385ec4b9f31817ae7d33362ca609fe838324b7 [formerly f17473045c7135f4d8b91b2a7faaf42e37a78b55] Former-commit-id: e6b3cf86c980bde897cbae481443f344705fee97
This commit is contained in:
parent
247c7ac561
commit
b16fad1031
8 changed files with 34 additions and 108 deletions
31
Dockerfile
Normal file
31
Dockerfile
Normal file
|
@ -0,0 +1,31 @@
|
|||
FROM alpine:3.6 as builder
|
||||
MAINTAINER github@erebe.eu
|
||||
|
||||
RUN apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
|
||||
ca-certificates git ghc upx curl musl-dev gmp-dev zlib-dev pcre-dev
|
||||
RUN curl -sSL https://get.haskellstack.org/ | sh
|
||||
|
||||
COPY stack.yaml /mnt
|
||||
COPY *.cabal /mnt
|
||||
WORKDIR /mnt
|
||||
RUN rm -rf ~/.stack && \
|
||||
stack config set system-ghc --global true && \
|
||||
stack setup && \
|
||||
stack install --split-objs --ghc-options="-fPIC -fllvm" --only-dependencies
|
||||
|
||||
COPY . /mnt
|
||||
|
||||
RUN stack install --split-objs --ghc-options="-fPIC -fllvm"
|
||||
RUN upx --ultra-brute /root/.local/bin/wstunnel
|
||||
|
||||
|
||||
|
||||
FROM alpine:latest as runner
|
||||
MAINTAINER github@erebe.eu
|
||||
|
||||
WORKDIR /root
|
||||
COPY --from=builder /root/.local/bin/wstunnel .
|
||||
RUN chmod +x ./wstunnel
|
||||
|
||||
ENTRYPOINT ["./wstunnel"]
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue