Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-15317

Allow building multi-architecture Docker images (e.g. ARM images)

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Please allow --privileged flag to build multiarch docker images.
      According to this article, it is possible with Github + Travis :
      http://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/

      Register qemu-*-static for all supported processors except the current one
      docker run --rm --privileged multiarch/qemu-user-static:register

      Currently, the following error is return when running the pipeline:

      • docker run --rm --privileged multiarch/qemu-user-static:register --reset
        docker: Error response from daemon: authorization denied by plugin pipelines: Command not supported.
        See 'docker run --help'.

      Thanks

            [BCLOUD-15317] Allow building multi-architecture Docker images (e.g. ARM images)

            Pinned comments

            Pinned by Edmund Munday

            Edmund Munday added a comment - - edited

            Hi all - as promised, we're excited to announce the release of ARM builds in the Pipelines cloud runtime.

            Head over to our announcement blog for all the details: 

            https://www.atlassian.com/blog/software-teams/announcing-arm-builds-in-cloud-for-bitbucket-pipelines

            Important note regarding multi-arch support:

            As mentioned, this initial release does make it possible to create multi-arch images using the `docker manifest` method, but does not support privileged containers or `buildx`.

            While less ergonomic than `buildx`, it should be noted that the `docker manifest` method can be significantly more performant than using `buildx` due to being able to leverage native runtimes for both architecture builds rather than qemu-based emulation which can be very slow.

            Stay tuned for future updates re: `buildx` support.

            Edmund Munday added a comment - - edited Hi all - as promised, we're excited to announce the release of ARM builds in the Pipelines cloud runtime. Head over to our announcement blog for all the details:  https://www.atlassian.com/blog/software-teams/announcing-arm-builds-in-cloud-for-bitbucket-pipelines Important note regarding multi-arch support: As mentioned, this initial release does make it possible to create multi-arch images using the `docker manifest` method , but does not support privileged containers or `buildx`. While less ergonomic than `buildx`, it should be noted that the `docker manifest` method can be significantly more performant than using `buildx` due to being able to leverage native runtimes for both architecture builds rather than qemu-based emulation which can be very slow. Stay tuned for future updates re: `buildx` support.

            All comments

            It's also possible to build multi-arch images with buildx via Bitbucket cloud pipeline. It's based on
            https://docs.docker.com/build-cloud/ci/.
             
            This step definition works well for us:

                      - step:
                          name: Build Docker image
                          script:
                            # Enable buildx
                            - mkdir -vp ~/.docker/cli-plugins/
                            - curl --silent -L --output ~/.docker/cli-plugins/docker-buildx "https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-amd64"
                            - chmod a+x ~/.docker/cli-plugins/docker-buildx                
                            - docker login --username $DOCKER_USER --password $DOCKER_PASSWORD
                            - docker buildx create --driver cloud flexifyio/flexify
                            # Build
                            - docker buildx build --builder cloud-flexifyio-flexify --platform linux/amd64,linux/arm64 --pull --tag flexifyio/engine:edge --push .
                          services:
                            - docker 

            It runs the actual Docker builds in Docker Build Cloud, but our Dockerfile just copies artifacts that we've built on the previous pipeline steps. It is completed in seconds and is not a big deal. 

            Sergey Kandaurov added a comment - It's also possible to build multi-arch images with buildx via Bitbucket cloud pipeline. It's based on https://docs.docker.com/build-cloud/ci/.   This step definition works well for us:         - step:               name: Build Docker image               script:                 # Enable buildx                 - mkdir -vp ~/.docker/cli-plugins/                 - curl --silent -L --output ~/.docker/cli-plugins/docker-buildx "https: //github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-amd64"                 - chmod a+x ~/.docker/cli-plugins/docker-buildx                                 - docker login --username $DOCKER_USER --password $DOCKER_PASSWORD                 - docker buildx create --driver cloud flexifyio/flexify                 # Build                 - docker buildx build --builder cloud-flexifyio-flexify --platform linux/amd64,linux/arm64 --pull --tag flexifyio/engine:edge --push .               services:                 - docker It runs the actual Docker builds in Docker Build Cloud, but our Dockerfile just copies artifacts that we've built on the previous pipeline steps. It is completed in seconds and is not a big deal. 

            Thanks 57465700c4e1! buildx seems to be much easier to use and is not less performant when used with Docker Build Cloud native builders, such as:
             

            docker buildx create --driver cloud flexifyio/flexify 
            docker buildx build --builder cloud-flexifyio-flexify ....

            Since such builds are performed in a cloud, they may actually not need privileged access.

            You may look at providing a service/builder specifically for buildx that would not require qemu-based emulation.

             

            Sergey Kandaurov added a comment - Thanks 57465700c4e1 ! buildx seems to be much easier to use and is not less performant when used with Docker Build Cloud native builders, such as:   docker buildx create --driver cloud flexifyio/flexify docker buildx build --builder cloud-flexifyio-flexify .... Since such builds are performed in a cloud, they may actually not need privileged access. You may look at providing a service/builder specifically for buildx that would not require qemu-based emulation.  

            Pinned by Edmund Munday

            Edmund Munday added a comment - - edited

            Hi all - as promised, we're excited to announce the release of ARM builds in the Pipelines cloud runtime.

            Head over to our announcement blog for all the details: 

            https://www.atlassian.com/blog/software-teams/announcing-arm-builds-in-cloud-for-bitbucket-pipelines

            Important note regarding multi-arch support:

            As mentioned, this initial release does make it possible to create multi-arch images using the `docker manifest` method, but does not support privileged containers or `buildx`.

            While less ergonomic than `buildx`, it should be noted that the `docker manifest` method can be significantly more performant than using `buildx` due to being able to leverage native runtimes for both architecture builds rather than qemu-based emulation which can be very slow.

            Stay tuned for future updates re: `buildx` support.

            Edmund Munday added a comment - - edited Hi all - as promised, we're excited to announce the release of ARM builds in the Pipelines cloud runtime. Head over to our announcement blog for all the details:  https://www.atlassian.com/blog/software-teams/announcing-arm-builds-in-cloud-for-bitbucket-pipelines Important note regarding multi-arch support: As mentioned, this initial release does make it possible to create multi-arch images using the `docker manifest` method , but does not support privileged containers or `buildx`. While less ergonomic than `buildx`, it should be noted that the `docker manifest` method can be significantly more performant than using `buildx` due to being able to leverage native runtimes for both architecture builds rather than qemu-based emulation which can be very slow. Stay tuned for future updates re: `buildx` support.

            Hi all - we will be releasing the ability to run steps on ARM via the cloud runtime in the next few weeks.

            This will make it possible to do multi-arch images via `docker manifest` upon release. To be clear, this will not initially include support for `buildx` - however we plan to ship `buildx` support relatively soon after shipping the ARM cloud runtime.

            This ticket will remain "in progress" until both ARM and `buildx` support are shipped.

            Edmund Munday added a comment - Hi all - we will be releasing the ability to run steps on ARM via the cloud runtime in the next few weeks. This will make it possible to do multi-arch images via `docker manifest` upon release. To be clear, this will not initially include support for `buildx` - however we plan to ship `buildx` support relatively soon after shipping the ARM cloud runtime. This ticket will remain "in progress" until both ARM and `buildx` support are shipped.

            +1

             

            Adding this to the "unbelievable that Bitbucket is not yet supporting it despite being nearly in 2025", right next to lacking OIDC support for Azure.

            Apparently Bitbucket keeps expecting people to express support for common-sense features, while the people who need them have gotten used to just employing workarounds.

            Andrei Dascalu added a comment - +1   Adding this to the "unbelievable that Bitbucket is not yet supporting it despite being nearly in 2025", right next to lacking OIDC support for Azure. Apparently Bitbucket keeps expecting people to express support for common-sense features, while the people who need them have gotten used to just employing workarounds.

            at this point, gitlab is the way...

            Oleg Tarassov added a comment - at this point, gitlab is the way...

            +1

            Ropelatto added a comment -

            +1

            Ropelatto added a comment - +1

            +1

            Rohit Gautam added a comment - +1

            +1

            Leonardo Rojas added a comment - +1

              57465700c4e1 Edmund Munday
              fd665ffff158 f4b1en
              Votes:
              467 Vote for this issue
              Watchers:
              267 Start watching this issue

                Created:
                Updated: