Repository navigation
refactor(compose): move the image build to internal/build - #14411
Merged
Merged
Conversation
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
4 of 15 tasks
ndeloof
force-pushed
the
internal-build
branch
from
October 29, 2026 07:24
a2e3243 to
efe2e46
Compare
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
ndeloof
force-pushed
the
internal-build
branch
from
October 29, 2026 11:05
efe2e46 to
b4d3064
Compare
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
ndeloof
force-pushed
the
internal-build
branch
2 times, most recently
from
November 4, 2026 17:07
9db33d3 to
dd1345a
Compare
ndeloof
force-pushed
the
internal-build
branch
2 times, most recently
from
November 16, 2026 13:41
3d251a6 to
5983d9a
Compare
glours
reviewed
Nov 16, 2026
The classic and bake builders, with the dispatch between them, become internal/build, which declares what it needs from the engine as a small Backend. composeService implements it and keeps a one-line build forwarder, so Build, watch and the image phase of up and run do not change. The environment variable resolver, shared with run, becomes its own internal/envresolver package, and the Building/Built events move to internal/progress next to the other events. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
ndeloof
force-pushed
the
internal-build
branch
from
November 16, 2026 13:59
5983d9a to
4d67afc
Compare
glours
enabled auto-merge (rebase)
November 16, 2026 14:04
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
3 tasks
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.
What this PR does, in one sentence
Moves the image build (the classic builder, the
buildx bakebuilder and the choice between them) out ofpkg/composeintointernal/build, behind a smallBackendinterface.Context
pkg/composeis one flat package where every operation is a method of the samecomposeService, so the build code can reach anything else in the engine (see #14396). The build is a good candidate to come out: it is a self-contained pipeline (resolve the services to build, translate them into a bake file or a classicImageBuildcall, run it, report the digests), and it only needs a handful of things from the rest of the engine.What the PR brings
internal/buildholds the build code and its tests, with the same assertions. It declares what it needs from the engine as aBackendof nine methods: the Docker CLI (client, credentials, terminal, buildx plugin), the event bus, the dry-run flag, the proxy settings, the concurrency limit, the canonical digest of a freshly built image,push, and the two shell-out helpers shared with the provider plugins.composeServiceimplements it and keeps a one-linebuildforwarder, soBuild,watchand the image phase ofup/run(ensureImagesExists) are untouched.ensureImagesExistsand the local image digest resolution stay inpkg/compose: they are the pull/images phase ofupthat calls the build, not the build itself, and moving them would have doubled theBackendfor no gain.Backend: the environment resolver (also used byrun) becomes its own tinyinternal/envresolverpackage, and theBuilding/Builtevents join the other events ininternal/progress.pkg/compose: everything that moved was unexported (the bake and classic helpers,buildxMinVersion,envResolver,buildingEvent/builtEvent).Why this is the right next brick
It follows the pattern of
internal/containerops,internal/inspectandinternal/providerfrom #14396. It does not depend on the other extractions in flight: the dependency traversal isinternal/depgraph, imported directly now that its move is onmain, and the image digest helpers are reached through theBackend, so it applies the same way before or afterinternal/images, and only the forwarders inpkg/compose/build.gowould then point to the new homes.Part of #14396
🤖 Generated with Claude Code