0b20dda5f9
Former-commit-id: 4f2bf12654ebbeb02fe727b168495cfd67b3abed Former-commit-id: 543d4994689c49e31c4344855134015ef81ebca9 [formerly cf22279f239f395e351cb9d4ffd3648e60a9880f] [formerly ff9021d9c296d72560450d9b3d72dc64e9695142 [formerly a96ad5215555a4fafe34a8cca56f86255731cf9d [formerly 5ec7f9aa22c15759fbc5aec2ba03733238a0b7d2] [formerly 5ec7f9aa22c15759fbc5aec2ba03733238a0b7d2 [formerly 5ec7f9aa22c15759fbc5aec2ba03733238a0b7d2 [formerly 4fcf744fd843ac36edd40b7b47495927773d0e6f]]]]] Former-commit-id: d6ee5bce6acd8c21dfe77ac654e12631bf9c4362 [formerly 3a08614ba9ed5fa761a6d1cdf6b3557ab4d172aa] Former-commit-id: da44f000e384c6fc71ad5c171c94b55582ca09e8 Former-commit-id: 2712e2ad0fb363e2d1544f2227e895d60125f018 Former-commit-id: 588843c91ebcdda0e5460969e61dda3c46265453 Former-commit-id: ec15288723177e1592579c9b16fddd4a5f9a8821 [formerly f641f618f4ef9c4185a6abe7405da6d2a8145326] Former-commit-id: 0f0f92ca988c92d0afe7d0b0663f06a162b4f759
43 lines
1.1 KiB
Docker
43 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 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 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
|
|
MAINTAINER github@erebe.eu
|
|
|
|
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"]
|
|
|