WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
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