-
Notifications
You must be signed in to change notification settings - Fork 277
/
Dockerfile
34 lines (25 loc) · 1005 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Build stage
FROM rust:1.72.1-bookworm AS cargo-build
RUN apt-get update
RUN apt-get install -y libgcc-12-dev libc6-dev pkg-config libssl-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"
ARG CARGO_OPTS="--features=ssl,workaround1,seqpacket,unix_stdio,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 debian:bookworm
RUN apt-get update
RUN apt-get install -y libssl3
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /
COPY --from=cargo-build /src/websocat/target/release/websocat /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/websocat"]