docker/buildx

Can you split up the build and push steps?

MauriceNino opened this issue · 3 comments

Related to #166

I want to first build the image, then do some other release steps and then release the image to docker hub.
For that, I thought I should use -o type=image,name=xxx.
But when I run docker manifest inspect xxx after that, it just returns the latest manifest from docker hub.

Where is the built manifest, and how can I push it after the build?

I am building for --platform linux/amd64,linux/arm/v7,linux/arm64/v8 if that is important.

To push from buildx you would run the build again with push option. If you have image in docker then you do docker push. If you have exported image in some other way(local registry, oci tarball) then there are external programs that can push from one registry to another etc.

Thank you for your answer!
Why is there no option to create the manifest and save it locally, so that it can later be picked up again? Or is that something that is technically not possible?

@tonistiigi What is the best output format and external program for outputting a multi-platform image and later pushing it to docker hub? As far as I read there are still problems with pushing OCI images to docker hub: docker/hub-feedback#1871

Building again with --cache-from and --push isn't very great because I'm using a multi-stage build, and only the first stage hits the cache.