From 6d0e9b6ab564c67cf63cf78f3181d8c361650aa8 Mon Sep 17 00:00:00 2001 From: Vitaly _Vi Shukela Date: Tue, 5 Nov 2024 22:50:40 +0100 Subject: [PATCH] Add old Dockerfile as Dockerfile.alpine --- Dockerfile.apline | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Dockerfile.apline diff --git a/Dockerfile.apline b/Dockerfile.apline new file mode 100644 index 0000000..63e2c23 --- /dev/null +++ b/Dockerfile.apline @@ -0,0 +1,29 @@ +# Build stage +FROM rust:1.72-alpine3.18 AS cargo-build + +RUN apk add --no-cache musl-dev pkgconfig openssl-dev + +WORKDIR /src/websocat +ENV RUSTFLAGS='-Ctarget-feature=-crt-static' + +COPY Cargo.toml Cargo.toml +ARG CARGO_OPTS="--features=workaround1,seqpacket,prometheus_peer,prometheus/process,crypto_peer" + +RUN mkdir src/ &&\ + echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \ + cargo build --release $CARGO_OPTS && \ + rm -f target/release/deps/websocat* + +COPY src src +RUN cargo build --release $CARGO_OPTS && \ + strip target/release/websocat + +# Final stage +FROM alpine:3.18 + +RUN apk add --no-cache libgcc + +WORKDIR / +COPY --from=cargo-build /src/websocat/target/release/websocat /usr/local/bin/ + +ENTRYPOINT ["/usr/local/bin/websocat"]