Skip to content

Commit

Permalink
Add comments to the rust flags
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeMahhouk committed Jan 17, 2025
1 parent 3e8e59d commit d531989
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ FROM rust:1.82-bullseye@sha256:c42c8ca762560c182ba30edda0e0d71a8604040af26723705
ARG BUILD_PROFILE=release
ENV BUILD_PROFILE=$BUILD_PROFILE

# Extra Cargo flags
ARG RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-Wl,--build-id=none -Clink-arg=-static-libgcc -C metadata='' --remap-path-prefix $(pwd)=."
# RUSTFLAGS breakdown:
# -C target-feature=+crt-static -> Statically link the C runtime library for standalone binaries
# -C link-arg=-Wl,--build-id=none -> Remove build ID from binary for reproducibility
# -Clink-arg=-static-libgcc -> Statically link against libgcc
# -C metadata='' -> Remove metadata hash from symbol names for reproducible builds
# --remap-path-prefix $(pwd)=. -> Replace absolute paths with '.' in debug info
ARG RUSTFLAGS="-C target-feature=+crt-static \
-C link-arg=-Wl,--build-id=none \
-Clink-arg=-static-libgcc \
-C metadata='' \
--remap-path-prefix $(pwd)=."
ENV RUSTFLAGS="$RUSTFLAGS"

# Extra Cargo features
Expand Down

0 comments on commit d531989

Please sign in to comment.