Add docker image output field to support publish to repository when using BuildKit (Cherry-pick of #20154) #20185
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.
Currently, the
publish
goal doesn't work with docker images when buildkit is enabled, as by default buildkit doesn't save the build output locally, andpublish
expects that the images were saved.This PR adds support for setting the output type, and defaults it to
docker
, which is the legacy docker build behavior, i.e. saves to the local image store.However, we only want to set that when buildkit is enabled. I thought it better to add an explicit option for that at the subsystem level; this allows for validation of buildkit-only options.
This eliminates the need to set
DOCKER_BUILDKIT=1
in env vars - I need to update the docs on that actually.I have validated that with this change, docker images can be published to a registry.