Deprecate nix dockerfile

Former-commit-id: cddbcef37ebe9a8f683659d87ba195da429d0fdd
Former-commit-id: 48764647f6e538039f3d383742e89c8839e99174 [formerly d333233a4eb32cbc7f90c18819ba3720e7043730] [formerly 7ca3407d95caae0b3103da1f1244c5483914f9de [formerly dff7c158337a0ae0bd98de7605ae859e244db4cd [formerly f8846510486f822294202a97b5b1ea3e25025e3e] [formerly f8846510486f822294202a97b5b1ea3e25025e3e [formerly f8846510486f822294202a97b5b1ea3e25025e3e [formerly 3a4793bd556c88c063419220faae4669427c8493]]]]]
Former-commit-id: cf5d3444897186021d40396f4fb8daa820954890 [formerly f92cbca0cf854f50ee1cb7373492709444a8e5fd]
Former-commit-id: e3edb9ae9523575907d858e4f401c70042486368
Former-commit-id: 1b62171a793c665623c0dfb8a97d3104809dcf42
Former-commit-id: 737061cd2adeea521e2f1cf31d434dc73f6a6c27
Former-commit-id: ea9fa483b758dfc15959d7e14207620032c3f844 [formerly 92993f8c81db2d474afddd03bd24f679245c8032]
Former-commit-id: 07bfbcf39b8c0f452f7c06001d4a141815a0f01c
This commit is contained in:
Romain GÉRARD 2020-01-06 00:37:16 +01:00
parent f0a616822f
commit a47bb20e44
4 changed files with 36 additions and 35 deletions

View file

@ -16,7 +16,7 @@ jobs:
- name: Build
run: |
docker build -t wstunnel -f Dockerfile.old .
docker build -t wstunnel .
docker run --rm -v $(pwd):/data wstunnel /bin/cp wstunnel /data
./wstunnel

View file

@ -1,15 +1,33 @@
FROM nixos/nix as builder
FROM alpine:3.11 as builder
MAINTAINER github@erebe.eu
RUN nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
RUN nix-channel --update
RUN nix-env -i bash upx
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
WORKDIR /mnt
COPY stack.yaml /mnt
COPY *.cabal /mnt
COPY default.nix /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
RUN nix-build --no-link -A fullBuildScript
COPY . /mnt
RUN $(nix-build --no-link -A fullBuildScript)
RUN echo ' ld-options: -static' >> wstunnel.cabal ; \
stack install --split-objs --ghc-options="-fPIC"
#RUN upx /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
CMD ["./wstunnel"]

View file

@ -1,33 +1,15 @@
FROM alpine:3.11 as builder
FROM nixos/nix as builder
MAINTAINER github@erebe.eu
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
RUN nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
RUN nix-channel --update
RUN nix-env -i bash upx
WORKDIR /mnt
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
COPY default.nix /mnt
RUN nix-build --no-link -A fullBuildScript
COPY . /mnt
RUN echo ' ld-options: -static' >> wstunnel.cabal ; \
stack install --split-objs --ghc-options="-fPIC"
#RUN upx /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
CMD ["./wstunnel"]
RUN $(nix-build --no-link -A fullBuildScript)

View file

@ -32,6 +32,7 @@ library
, text >= 1.2.2.1
, unordered-containers
, websockets >= 0.12.4.0
, iproute
default-language: Haskell2010