Hello,
I was very excited about the Pipeline runtime v3 release and wanted to use it for publishing multi-arch docker images using it.
I followed your documentation, to build images for platforms linux/amd64 and linux/arm64. They are built correctly. However, I'm not able to list them with `docker image ls --tree` nor publishing them in a separate step.
I followed your instructions by first creating an image with docker-cli, compose and buildx preinstalled and then defining a pipeline custom trigger to build the docker multi-arch image as described in 'Multi -arch Build' section.
The build produces this warning message:
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Is there a way with bitbucket pipeline runtime v3 to list and publish multi-arch docker images after the build step?
Thank you very much for your help!
Hi @Antoine
Welcome to the community.
Could you please share your YAML config for us to check? Please mask any sensitive information before sharing it
Regards,
Mark C
Hello @Mark C
Thank you for your support.
I used the config given in the documentation
options:
runtime:
cloud:
version: "3"
pipelines:
custom:
multi-arch-build:
- step:
image: "<my-image-with-docker-cli-and-buildx>"
services:
- docker
script
- docker buildx create --name multiarch-builder --driver docker-container --use
- docker buildx inspect --bootstrap
- docker run --rm --privileged tonistiigi/binfmt --install all
- docker buildx build -t test:local --platform=linux/amd64,linux/arm64 .
- docker image ls --tree # won't return any image
- docker image push test:local # fails
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Antoine
Apologies for the delay - I have taken a look into this in Marks absence.
When using docker buildx build
with the docker-container
driver, the built image is not automatically loaded into the local Docker image store. Instead, it stays in the BuildKit cache unless you specify an output option - hence why you receive the error:
--push
to push the image directly to a registry.
--load
to load the image into the local Docker daemon (only works for single-platform builds).
Docker image ls
shows nothing as the image is not available locally because it was never loaded (--load
) or pushed (--push
). That's why docker image ls --tree
returns nothing, and docker image push test:local
fails—there's no local image to push
Please modify your YAML config to the following and let me know if it's successful:
script:
- docker login -u $DOCKER_USER -p $DOCKER_PASS <your-registry>
- docker buildx create --name multiarch-builder --driver docker-container --use
- docker buildx inspect --bootstrap
- docker run --rm --privileged tonistiigi/binfmt --install all
- docker buildx build -t <your-registry>/<your-image>:<tag> --platform=linux/amd64,linux/arm64 --push .
If you're still encountering issues - please raise a ticket directly with our support team using your paid workspace URL to ensure you receive timely responses according to our SLA. Raising a formal ticket will allow us to gain access to your workspace to check your YAML config/build logs in detail:
If you have issues raising a ticket - please let me know your timezone and I will raise one on your behalf with the relevant team in your region.
Cheers!
- Ben (Bitbucket Cloud Support)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Ben
Thanks a lot for your support and all the explanations!
Thing is we have internal tooling I would like to reuse for multi-arch builds. This imposes to push images in a separate step and not during the build step.
From what I understand from docker doc it would help having access to containerd which is able to store multi-arch images. Do you know if that's possible with the new pipeline runtime v3?
Thank you!
Antoine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Antoine
Apologies for the late response here.
What you can do is to use --load flag in the buildx command if you'd like to access the built container within the same step.
Regards,
Mark C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.