How to build ARM64 docker images with Azure DevOps Pipelines?

--

Azure DevOps doesn’t directly support specifying the architecture in the pipeline YAML. However, you can still achieve ARM64 builds in Azure DevOps pipelines through QEMU emulator.

Example:
Build arm64 Image with the help of QEMU and Push to Docker Hub Registry.

trigger:
branches:
include:
- main

pool:
vmImage: 'ubuntu-latest'

variables:
- name: container_registry
value: test
- name: repository
value: test/test

steps:
- task: CmdLine@2
displayName: 'Install emulator'
inputs:
script: 'sudo apt-get install -y qemu qemu-user-static'

- task: Docker@2
displayName: 'Login'
inputs:
containerRegistry: $(container_registry)
command: 'login'

- task: Docker@2
displayName: 'Build'
inputs:
containerRegistry: $(container_registry)
repository: $(repository)
command: 'build'
arguments: '--platform linux/arm64'
Dockerfile: 'Dockerfile'
tags: 'latest'

- task: Docker@2
displayName: 'Push'
inputs:
containerRegistry: $(container_registry)
repository: $(repository)
command: 'push'
tags: 'latest'

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response