fix: add --load to buildx to ensure images are available locally #424
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
--loadflag to buildx command to load built images into the local Docker daemonProblem
When building v4 services with buildx, the resulting image was sometimes not found:
By default,
docker buildx buildonly stores images in the buildx cache—not the local Docker daemon's image store. When Docker Compose later tries to start containers, it can't find the image.Solution
Add
--load(--output=type=docker) to export the build result into the local Docker daemon, making images immediately available for use.Note
Ensures images built with Buildx are available to the local Docker daemon.
--loadtobuildx buildincomponents/docker-engine.jsso--tagged images are loaded locallyCHANGELOG.mdunderUNRELEASEDto document the fixWritten by Cursor Bugbot for commit 6ac2ad9. This will update automatically on new commits. Configure here.