diff --git a/Dockerfile b/Dockerfile index 1c8f857..c966761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,7 @@ # Build stage -FROM rust:1.45.0 as cargo-build +FROM rust:1.60-alpine3.15 as cargo-build -RUN apt-get update && \ - apt-get install -y --no-install-recommends musl-tools -RUN rustup target add x86_64-unknown-linux-musl +RUN apk add --no-cache musl-dev pkgconfig openssl-dev WORKDIR /src/websocat @@ -11,14 +9,14 @@ COPY Cargo.toml Cargo.toml RUN mkdir src/ &&\ echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \ - RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl && \ + cargo build --release --target=x86_64-unknown-linux-musl && \ rm -f target/x86_64-unknown-linux-musl/release/deps/websocat* COPY . . -RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl +RUN cargo build --release --target=x86_64-unknown-linux-musl # Final stage -FROM alpine:3.12.0 +FROM alpine:3.15 WORKDIR / COPY --from=cargo-build /src/websocat/target/x86_64-unknown-linux-musl/release/websocat /usr/local/bin