Skip to content

Commit

Permalink
fix(docker): Add support for RUSTFLAGS and feature flags in Dockerfile (
Browse files Browse the repository at this point in the history
  • Loading branch information
KyrylR authored Apr 17, 2024
1 parent 70db3d8 commit f4386c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ COPY --from=planner /app/recipe.json recipe.json
ARG BUILD_PROFILE=release
ENV BUILD_PROFILE $BUILD_PROFILE

# Extra Cargo flags
ARG RUSTFLAGS=""
ENV RUSTFLAGS "$RUSTFLAGS"

# Extra Cargo features
ARG FEATURES=""
ENV FEATURES $FEATURES
Expand All @@ -24,7 +28,7 @@ ENV FEATURES $FEATURES
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config

# Builds dependencies
RUN cargo chef cook --profile $BUILD_PROFILE --recipe-path recipe.json
RUN cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --recipe-path recipe.json

# Build application
COPY . .
Expand Down

0 comments on commit f4386c9

Please sign in to comment.