Only include source files needed to build compute_ctl

This avoids the slow recompilation of the docker layers, if some
unrelated files are modified.
This commit is contained in:
Heikki Linnakangas
2025-01-19 21:48:39 +02:00
parent 2884917bd4
commit 2c680bad4d

View File

@@ -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 \