From 4890e77b1f3a40e696362d4cf5dca18625714f1c Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:49:53 +0100 Subject: [PATCH 1/2] misc: Use cargo-chef 0.1.64 --bin flags for faster builds --- Containerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index 055970011..89fe68d48 100644 --- a/Containerfile +++ b/Containerfile @@ -27,7 +27,6 @@ RUN find . \( \ \) -type f -exec install -D \{\} /build/\{\} \; WORKDIR /build RUN cargo chef prepare --recipe-path /recipe.json -# TODO upstream: Reduce the cooking by allowing multiple --bin args to prepare, or like this https://github.com/LukeMathWalker/cargo-chef/issues/181 # Builds crate according to cargo chef recipe. @@ -39,13 +38,19 @@ COPY --from=chef-planner /recipe.json / RUN cargo chef cook \ --all-features \ $(if [ "$CARGO_PROFILE" = "release" ]; then echo --release; fi) \ - --recipe-path /recipe.json + --recipe-path /recipe.json \ + --bin shuttle-auth \ + --bin shuttle-deployer \ + --bin shuttle-gateway \ + --bin shuttle-logger \ + --bin shuttle-provisioner \ + --bin shuttle-resource-recorder \ + --bin shuttle-next COPY --from=chef-planner /build . # Building all at once to share build artifacts in the "cook" layer RUN cargo build \ $(if [ "$CARGO_PROFILE" = "release" ]; then echo --release; fi) \ --bin shuttle-auth \ - # --bin shuttle-builder \ --bin shuttle-deployer \ --bin shuttle-gateway \ --bin shuttle-logger \ From f0865e69b5d8626b110674d57555dbcc103e2b44 Mon Sep 17 00:00:00 2001 From: jonaro00 <54029719+jonaro00@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:25:27 +0100 Subject: [PATCH 2/2] nit: better dockerignore --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index 0bad4b70a..0f783c818 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,8 @@ **/target/ +**/.shuttle-executables **/*Containerfile* /examples +.git **/.cargo/ **/docker/ **/*.md