Skip to content

Commit

Permalink
Add old Dockerfile as Dockerfile.alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
vi committed Nov 5, 2024
1 parent 1af4bd8 commit 6d0e9b6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile.apline
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 6d0e9b6

Please sign in to comment.