From 405765b18c83a252e3a4f55d208d74cd995b4f4b Mon Sep 17 00:00:00 2001 From: ur4t <46435411+ur4t@users.noreply.github.com> Date: Tue, 25 Jun 2024 00:16:36 +0800 Subject: [PATCH] Fix cargo-chef prepare (#2101) * Fix cargo-chef prepare In prepare stage, cargo-chef reads Cargo.lock and transforms it accordingly. If Cargo.lock is not present, cargo-chef will generate a new one first, which might vary a lot and invalidate docker build caches. * Fix Dockerfile_amd and Dockerfile_intel --- Dockerfile | 1 + Dockerfile_amd | 1 + Dockerfile_intel | 1 + 3 files changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index c93372a2..d5750ac8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse FROM chef as planner +COPY Cargo.lock Cargo.lock COPY Cargo.toml Cargo.toml COPY rust-toolchain.toml rust-toolchain.toml COPY proto proto diff --git a/Dockerfile_amd b/Dockerfile_amd index 55da9204..e325bb65 100644 --- a/Dockerfile_amd +++ b/Dockerfile_amd @@ -5,6 +5,7 @@ WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse FROM chef as planner +COPY Cargo.lock Cargo.lock COPY Cargo.toml Cargo.toml COPY rust-toolchain.toml rust-toolchain.toml COPY proto proto diff --git a/Dockerfile_intel b/Dockerfile_intel index 35362fc9..131f49ba 100644 --- a/Dockerfile_intel +++ b/Dockerfile_intel @@ -4,6 +4,7 @@ WORKDIR /usr/src ARG CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse FROM chef as planner +COPY Cargo.lock Cargo.lock COPY Cargo.toml Cargo.toml COPY rust-toolchain.toml rust-toolchain.toml COPY proto proto