fix(docker): Add support for RUSTFLAGS and feature flags in Dockerfile (#7658)

This commit is contained in:
Kyrylo Riabov
2024-04-17 10:25:01 +03:00
committed by GitHub
parent 70db3d8276
commit f4386c9cd5

View File

@ -16,6 +16,10 @@ COPY --from=planner /app/recipe.json recipe.json
ARG BUILD_PROFILE=release ARG BUILD_PROFILE=release
ENV BUILD_PROFILE $BUILD_PROFILE ENV BUILD_PROFILE $BUILD_PROFILE
# Extra Cargo flags
ARG RUSTFLAGS=""
ENV RUSTFLAGS "$RUSTFLAGS"
# Extra Cargo features # Extra Cargo features
ARG FEATURES="" ARG FEATURES=""
ENV FEATURES $FEATURES ENV FEATURES $FEATURES
@ -24,7 +28,7 @@ ENV FEATURES $FEATURES
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config
# Builds dependencies # 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 # Build application
COPY . . COPY . .