Skip to content

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Nov 12, 2025

c8d/builder-next: Skip unpacking when push=true

The image exporter wrapper was unconditionally setting unpack=true for
all build exports when no explicit unpack option was provided. This
caused unnecessary unpacking overhead when images were only being pushed
to a registry and not intended for local execution.

containerd image store: Images built with `docker build --push` will no longer be unpacked automatically. 

@vvoland vvoland self-assigned this Nov 12, 2025
@vvoland vvoland added area/builder Build kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/builder/buildkit Build containerd-integration Issues and PRs related to containerd integration labels Nov 12, 2025
@github-actions github-actions bot added the area/daemon Core Engine label Nov 12, 2025
@vvoland vvoland marked this pull request as draft November 12, 2025 13:44
The image exporter wrapper was unconditionally setting `unpack=true` for
all build exports when no explicit unpack option was provided. This
caused unnecessary unpacking overhead when images were only being pushed
to a registry and not intended for local execution.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland force-pushed the c8d-build-pushnounpack branch from a8d52fe to 28c7364 Compare November 12, 2025 15:40
@vvoland vvoland marked this pull request as ready for review November 12, 2025 15:40
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpuguy83
Copy link
Member

I feel like not unpacking is going to surprising.
Should we expose the option on the API?

@tonistiigi
Copy link
Member

I don't think we should change the unpack behavior based on push. They are both similar independent options to the image exporter in buildkit.

If this is desirable we could consider buildx cli setting unpack=false by default if --push or -o type=registry are used there. These are buildx-specific shorthands that just configure the image exporter internally but we can update the definition of the shorthand if it is used without other options.

@vvoland
Copy link
Contributor Author

vvoland commented Nov 13, 2025

I feel like not unpacking is going to surprising. Should we expose the option on the API?

This is already exposed - with #51493 you can set unpack option to whatever you want.

It might be a bit surprising that the first image use will take a bit longer.. but for build that pushes immediately, I think it would be fairly safe to assume that the main use-case is not running the image locally.

I don't think we should change the unpack behavior based on push. They are both similar independent options to the image exporter in buildkit.

If this is desirable we could consider buildx cli setting unpack=false by default if --push or -o type=registry are used there. These are buildx-specific shorthands that just configure the image exporter internally but we can update the definition of the shorthand if it is used without other options.

Doing this on buildx side seems good to me too. Opened: docker/buildx#3519

@thompson-shaun
Copy link
Contributor

Closing in favor of docker/buildx#3519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/builder/buildkit Build area/builder Build area/daemon Core Engine containerd-integration Issues and PRs related to containerd integration impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker build --push always unpacks into moby snapshotter

5 participants