From 1e5ec4afb792d0b8670f8e2dbafd0290ba0074fc Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 18 Aug 2023 17:12:43 -0700 Subject: [PATCH] keep cargo fetch to avoid race condition --- Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Dockerfile b/Dockerfile index c989685a..0001e6bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,6 +79,18 @@ FROM rust as rust_with_env # changing our features doesn't change any of the steps above ENV WEB3_PROXY_FEATURES "rdkafka-src" +# fill the package caches +RUN --mount=type=bind,source=.,target=/app,rw \ + --mount=type=cache,target=/root/.cargo/git \ + --mount=type=cache,target=/root/.cargo/registry \ + --mount=type=cache,target=/app/target \ + set -eux -o pipefail; \ + \ + [ -e "$(pwd)/payment-contracts/src/contracts/mod.rs" ] || touch "$(pwd)/payment-contracts/build.rs"; \ + cargo \ + --locked \ + fetch + # build tests (done its in own FROM so that it can run in parallel) FROM rust_with_env as build_tests