Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Multiarchitecture docker build image using bitbucket pipelines

sathish 2905
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 19, 2024

 

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
56
exec /register: exec format error
Getting this error while using the below bitbucket-pipelines.yml
pipelines:
default:
- step:
name: My Runner
image: atlassian/default-image:4
runs-on:
- linux
- self.hosted
services:
- docker
script:
- echo "Executing on self-hosted runner"
- export DOCKER_CLI_EXPERIMENTAL=enabled # Enable usage of buildx in Docker version < 23
- export BUILDX_VERSION=0.11.0 # define what BUILDX_VERSION to download and install
- mkdir -p $HOME/.docker/cli-plugins/ && mv buildx-v${BUILDX_VERSION}.linux-amd64 $HOME/.docker/cli-plugins/docker-buildx && chmod +x ~/.docker/cli-plugins/docker-buildx # download buildx and move it to the docker plugin folder
- docker run --rm multiarch/qemu-user-static --reset -p yes; docker buildx create --use # setup the QEMU emulation environment
#- echo $DOCKER_HUB_PASS | docker login --username $DOCKER_HUB_USER --password-stdin # login to Dockerhub
- docker buildx build -t $DOCKER_HUB_USER/my_image_multi_arch:my_tag --push --platform linux/amd64,linux/arm64,linux/arm/v7 . # Build multi-architecture image for the platforms provided and push to Dockerhub
definitions:
services:
docker: # Define a custom docker daemon - can only be used with a self-hosted runner
image: docker:dind

1 answer

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2024

Hi @sathish 2905 and welcome to the community!

Since the error message mentions that the host platform is linux/arm64/v8, I assume you are running this build on a self-hosted Linux Docker ARM runner. Is that correct?

Do you get this error while one of the build's commands get executed, and if so which one?

I'm not sure which image the command docker buildx build is using, however the docker run command is using the DockerHub image multiarch/qemu-user-static. Checking this image in DockerHub, it looks like it doesn't support ARM architecture:

You can see on the page above that only linux/amd64 is mentioned for OS/ARCH. So, you can only use this image on a host with linux/amd64.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events