wstunnel/Dockerfile
Romain GERARD f8fb2cf186 Bump docker file
Former-commit-id: e9b1a53d3d2c0b75a8b35b616b350643f5880e90
Former-commit-id: 386a98bbe4cca7a2910943c2ec8cf461b4a6da15 [formerly c425e63f57445ea0df15fd4fd475f32bbbd1b7d6] [formerly 3779724a48c64598b43fb18b7c388de0308a11c5 [formerly dbb52ed009728087c4e52431434a29daec8078ce [formerly dbb52ed009728087c4e52431434a29daec8078ce [formerly dbb52ed009728087c4e52431434a29daec8078ce [formerly 865078529d0929452f283e6a799a6bfe621b1464]]]]]
Former-commit-id: c7fa27e430786f39d58aa116212c996abaabb42a [formerly 4cf25dbd9cfabc5c7c0cc6dbdb732ff5fb1123d7]
Former-commit-id: 69fb620e05009d8beb23ca4b40c4ed1a4b10cf58
Former-commit-id: 3ce22bea614ff3060b6a26db66a2131cd1925adf
Former-commit-id: 46d0b2a371811d06d3faea50f918c038e57cdabf
Former-commit-id: 28d0846ee79fd6596f7f9586057ed45bdaa86b07 [formerly a2a0e84f95c5f99a0cd69dda1a8320cdd689c755]
Former-commit-id: 4d36ec94aed32cfd06261abd3aa084d64c9578a3
2020-12-08 09:47:21 +01:00

44 lines
1.1 KiB
Docker

# Build Cache image
FROM alpine:3.12 as builder-cache
RUN apk --no-cache add ca-certificates git ghc curl musl-dev gmp-dev zlib-dev zlib-static pcre-dev xz make upx
RUN curl -sSL https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-linux-x86_64-static.tar.gz | tar xvz && \
mv stack*/stack /usr/bin
COPY stack.yaml /mnt
COPY *.cabal /mnt
WORKDIR /mnt
RUN sed -i 's/lts-16.25/lts-16.4/' stack.yaml && \
rm -rf ~/.stack && \
stack config set system-ghc --global true && \
stack setup && \
stack install --split-objs --ghc-options="-fPIC" --only-dependencies
# Build phase
#FROM builder-cache as builder
FROM ghcr.io/erebe/wstunnel:build-cache as builder
COPY . /mnt
RUN sed -i 's/lts-16.25/lts-16.4/' stack.yaml
RUN echo ' ld-options: -static' >> wstunnel.cabal ; \
stack install --split-objs --ghc-options="-fPIC"
#RUN upx /root/.local/bin/wstunnel
# Final Image
FROM alpine:latest as runner
LABEL org.opencontainers.image.source https://github.com/erebe/server
COPY --from=builder /root/.local/bin/wstunnel /
RUN adduser -D abc && chmod +x /wstunnel
USER abc
WORKDIR /
CMD ["/wstunnel"]