From f4386c9cd5e03f763026b0b2f82588c780aa63a6 Mon Sep 17 00:00:00 2001 From: Kyrylo Riabov Date: Wed, 17 Apr 2024 10:25:01 +0300 Subject: [PATCH] fix(docker): Add support for RUSTFLAGS and feature flags in Dockerfile (#7658) --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5dac92bb9..f1cc4d804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 . .