Skip to content

Commit

Permalink
fix(docker): specify CARGO_BUILD_RUSTFLAGS earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Oct 25, 2023
1 parent 4d5fed2 commit 03b87fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ COPY . ./
RUN cargo chef prepare --recipe-path recipe.json

FROM common-build AS builder
ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static"

COPY --from=planner /build/recipe.json recipe.json
RUN cargo chef cook --recipe-path recipe.json --release --locked --target x86_64-unknown-linux-musl --bin valfisk
RUN cargo chef cook --recipe-path recipe.json --release --locked --target x86_64-unknown-linux-musl

COPY . ./
ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static"
RUN cargo build --release --locked --target x86_64-unknown-linux-musl --bin valfisk

FROM gcr.io/distroless/static:latest
Expand Down

0 comments on commit 03b87fc

Please sign in to comment.