fix(docker): decouple service builds to enable parallel execution#42
Open
ChefControl wants to merge 2 commits into
Open
fix(docker): decouple service builds to enable parallel execution#42ChefControl wants to merge 2 commits into
ChefControl wants to merge 2 commits into
Conversation
Each Rust Dockerfile now copies only the Cargo.toml manifests from sibling workspace members (plus a stub source file) instead of the full source tree. Per-Dockerfile .dockerignore files exclude irrelevant directories from the build context, eliminating I/O contention between concurrent builds. Closes #41 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cargo fetch --locked step downloads ALL workspace dependencies including transitive ones requiring edition2024 (unsupported by Rust 1.83). Remove it and let cargo build handle downloads for only the target package's dependencies. Use per-service cache IDs (e.g. id=manager-cargo-registry) so parallel builds don't contend over shared BuildKit cache mounts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.dockerignorefiles (BuildKit feature) to exclude irrelevant directories from each service's build contextcargo fetch --lockedlayer that caches dependency downloads separately from source compilation, improving rebuild timesHow it works
Each Rust Dockerfile now:
Cargo.tomlfiles from all workspace members (not source code)main.rs/lib.rsfor members it doesn't compilecargo fetch --lockedto cache dependencies in a separate layershared/and the target serviceThe
Dockerfile.dockerignorefiles ensure Docker only sends relevant files as build context — the manager build excludesfrontend/andfeeder/src/, and vice versa. This eliminates I/O contention between concurrent builds.Test plan
docker build -t manager:test -f manager/Dockerfile .docker build -t feeder:test -f feeder/Dockerfile .docker build -t frontend:test frontendCloses #41
🤖 Generated with Claude Code