From 2c680bad4d869a1e16d808a11da8fd7d3c7dddd3 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sun, 19 Jan 2025 21:48:39 +0200 Subject: [PATCH] Only include source files needed to build compute_ctl This avoids the slow recompilation of the docker layers, if some unrelated files are modified. --- compute/compute-node.Dockerfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/compute/compute-node.Dockerfile b/compute/compute-node.Dockerfile index 1236372d27..a62b392a10 100644 --- a/compute/compute-node.Dockerfile +++ b/compute/compute-node.Dockerfile @@ -1624,7 +1624,19 @@ ENV BUILD_TAG=$BUILD_TAG USER nonroot # Copy entire project to get Cargo.* files with proper dependencies for the whole project -COPY --chown=nonroot . . +COPY --chown=nonroot Cargo.lock Cargo.toml rust-toolchain.toml . +COPY .cargo .cargo +COPY .config .config +COPY compute_tools compute_tools +COPY control_plane control_plane +COPY libs libs +COPY pageserver pageserver +COPY proxy proxy +COPY storage_scrubber storage_scrubber +COPY safekeeper safekeeper +COPY storage_broker storage_broker +COPY storage_controller storage_controller +COPY workspace_hack workspace_hack RUN --mount=type=cache,uid=1000,target=/home/nonroot/.cargo/registry \ --mount=type=cache,uid=1000,target=/home/nonroot/.cargo/git \ --mount=type=cache,uid=1000,target=/home/nonroot/target \