You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common pattern I've used a lot is to have a two step build pipeline. The first step is to build the docker image and run tests etc. The second step is only run if some condition is true, and pushes the image to a registry.
When using buildx to build a multi-platform image, I can't seem to find a set of commands that allows me to do this. There are several output options that will save a multi-platform image to disk, either as a file tree, a tarball, or an OCI Image tarball. But I haven't been able to find a way to take that output and upload it to a registry in the next step.
Crucially, I don't want to run the build again, because that will happen in a different runner without any cache. Running the build again opens up the possibility that something changes, and then you push an untested image to the registry.
The way I do this with normal docker and single-platform images:
I have the same request, but for a slightly different reason: CI time & code reduction. I would like to avoid running the same build twice in CI, and it would be nice to define the build a single time and share it across multiple tagging & deployment jobs.
Hm. Does this issue cover the case where one wants to save out architecture specific images from the cache that buildx produced. I'd like to do docker save for each architecture specific image that buildx build --platform foo,bar produced.
A common pattern I've used a lot is to have a two step build pipeline. The first step is to build the docker image and run tests etc. The second step is only run if some condition is true, and pushes the image to a registry.
When using buildx to build a multi-platform image, I can't seem to find a set of commands that allows me to do this. There are several output options that will save a multi-platform image to disk, either as a file tree, a tarball, or an OCI Image tarball. But I haven't been able to find a way to take that output and upload it to a registry in the next step.
Crucially, I don't want to run the build again, because that will happen in a different runner without any cache. Running the build again opens up the possibility that something changes, and then you push an untested image to the registry.
The way I do this with normal docker and single-platform images:
First step:
docker build . --tag "${IMAGE_NAME}:${TAG}" --tag "${IMAGE_NAME}:latest"
docker image save "${IMAGE_NAME}:${TAG}" "${IMAGE_NAME}:latest" | bzip2 > docker.tar.bz2
docker.tar.bz2
to suitable artifact storageSecond step:
docker.tar.bz2
from artifact storagebunzip2 --stdout docker.tar.bz2 | docker image load
docker push "${IMAGE_NAME}"
The text was updated successfully, but these errors were encountered: