From 464965ae33c8de7321f00b9c11ae42ec96cbc0f8 Mon Sep 17 00:00:00 2001 From: meeg_leeto Date: Sat, 30 Apr 2022 14:24:31 +0100 Subject: [PATCH] fix: cargo really is ignoring PROFILE venv --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7bce22c..f3b433b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,13 +10,17 @@ COPY ./Cargo.toml /lonk/Cargo.toml ARG PROFILE -RUN cargo build +RUN [ "${PROFILE}" = "debug" ] \ + && cargo build \ + || cargo build --release RUN rm src/*.rs # Compile the source COPY ./src ./src RUN rm -f ./target/${PROFILE:-release}/deps/lonk* -RUN cargo build +RUN [ "${PROFILE}" = "debug" ] \ + && cargo build \ + || cargo build --release # Execution container FROM rust:slim