Skip to content

Commit

Permalink
add static linking to default dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-bcw committed Aug 15, 2024
1 parent c5e3737 commit 0817818
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 @@ -31,7 +31,7 @@ ARG PROFILE=release
# forward the docker argument so that the script below can read it
ENV PROFILE=${PROFILE}

ENV RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld'
ENV RUSTFLAGS='-C target-feature=+crt-static -C target-cpu=native -Zlinker-features=-lld'

# Build the application.
RUN \
Expand All @@ -50,7 +50,7 @@ cd /src

# use the cache mount
# (we will not be able to to write to e.g `/src/target` because it is bind-mounted)
CARGO_TARGET_DIR=/artifacts cargo build --locked "--profile=${PROFILE}" --all
CARGO_TARGET_DIR=/artifacts cargo build --locked "--profile=${PROFILE}" --all --target=x86_64-unknown-linux-gnu

# narrow the find call to SUBDIR because if we just copy out all executables
# we will break the cache invariant
Expand Down

0 comments on commit 0817818

Please sign in to comment.