add --load flag to docker buildx build - #2452
Conversation
Export the built image to the local Docker daemon so it is available for subsequent steps, example docker images. By default, buildx builds images using BuildKit and leaves the result in the build cache without exporting it anywhere. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@est.tech>
|
/cc @marquiz |
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/test pull-node-feature-discovery-build-image-cross-generic |
|
@fmuyassarov: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
well, I guess we need the Prow infra to bump their docker before we move on :) |
ozhuraki
left a comment
There was a problem hiding this comment.
LGTM, in case you decide to move with docker upgrade
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fmuyassarov, ozhuraki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
ArangoGutierrez
left a comment
There was a problem hiding this comment.
Adding --load to image-all fixes a real local-dev annoyance — today the multi-arch build result stays in the buildx cache and never shows up in docker images. The blocker is that multi-arch --load requires the containerd image store in the daemon, so the required cross-build Prow job fails (details inline) and waiting for a generic docker bump may not resolve it; an opt-in flag would keep CI green without depending on infra. Separately, docs/developer-guide/index.md (lines 58-60) still says docker cannot load manifest-lists and links the same buildx#59 this PR drops from the Makefile — that paragraph should be updated here too. Not mergeable as-is with the required job red; good to go once the flag is opt-in (or Prow's daemon actually supports containerd-store loads) and the doc is refreshed.
| # --load : not implemented yet, see: https://github.com/docker/buildx/issues/59 | ||
| $(IMAGE_BUILDX_CMD) $(IMAGE_BUILD_ARGS) $(IMAGE_BUILD_ARGS_FULL) | ||
| $(IMAGE_BUILDX_CMD) $(IMAGE_BUILD_ARGS) $(IMAGE_BUILD_ARGS_MINIMAL) | ||
| $(IMAGE_BUILDX_CMD) --load $(IMAGE_BUILD_ARGS) $(IMAGE_BUILD_ARGS_FULL) |
There was a problem hiding this comment.
Multi-arch --load only works when the daemon runs the containerd image store (recent engines default to it on fresh installs only), which is exactly what the required pull-node-feature-discovery-build-image-cross-generic job hits — scripts/test-infra/build-image-cross.sh runs this target with IMAGE_ALL_PLATFORMS=linux/amd64,linux/arm64. Rather than waiting on Prow infra, consider making this opt-in: an empty-default IMAGE_BUILDX_LOAD ?= variable referenced here, or simply document make image-all IMAGE_BUILD_EXTRA_OPTS=--load, which already works today against a containerd-store daemon. Opt-in also spares the default 5-platform build from exporting every arch variant of both images into the local daemon.
|
/assign @ArangoGutierrez |
Export the built image to the local Docker daemon so it is available for subsequent steps, example docker images. By default, buildx builds images using BuildKit and leaves the result in the build cache without exporting it anywhere.
Note: building images for multi arch with
--loadparameter is now supported and fixed in docker buildx. See docker/buildx#59.