https://github.com/rcarmo/azure-pipelines-multiarch-docker
A reference example on how to build multi-arch Linux images using Azure Pipelines
https://github.com/rcarmo/azure-pipelines-multiarch-docker
amd64 arm32v7 arm64v8 azure devops docker pipelines zsh
Last synced: about 1 year ago
JSON representation
A reference example on how to build multi-arch Linux images using Azure Pipelines
- Host: GitHub
- URL: https://github.com/rcarmo/azure-pipelines-multiarch-docker
- Owner: rcarmo
- License: apache-2.0
- Created: 2019-06-22T13:09:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-22T18:42:52.000Z (almost 7 years ago)
- Last Synced: 2025-03-18T16:22:37.098Z (over 1 year ago)
- Topics: amd64, arm32v7, arm64v8, azure, devops, docker, pipelines, zsh
- Language: Makefile
- Size: 69.3 KB
- Stars: 17
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# azure-pipelines-multiarch-docker
[](https://hub.docker.com/r/insightful/ubuntu-gambit)
[](https://hub.docker.com/r/insightful/ubuntu-gambit)
[](https://microbadger.com/images/insightful/ubuntu-gambit "Get your own image badge on microbadger.com")
[](https://microbadger.com/images/insightful/ubuntu-gambit "Get your own version badge on microbadger.com")
[](https://dev.azure.com/ruicarmo/insightfulsystems/_build/latest?definitionId=5&branchName=master)
This is a shim/template repo for an Azure DevOps pipeline to build multi-architecture images:
## Pipeline Structure
At the Azure Pipelines level, this creates:

* One independent stage for each CPU architecture
* A "wrap-up" stage that runs after all the others that builds and publishes the Docker manifest file
## Why?
Because I needed a simple, re-usable example of how to build multi-architecture images (in, this case, Linux for several different CPU architectures) that I could both re-use and share with customers.
## How?
Images are created atop a local base (in this case Ubuntu) with a corresponding `qemu-user-static` binary embedded, which allows most CI systems to build ARM images atop an `amd64` CPU.
The sample `src/Dockerfile` only installs `zsh` into that image, but the intent is that you can build this up from there.
## Internals
Most of the image generation logic (including embedding QEMU and building the final manifest that allows for automatic discovery of architecture-specific tags) lives inside the `Makefile`.
This is done because:
* Having a `Makefile` allows for easy local testing
* It also allows for easy movement between different CI systems
* The actual architecture tagging (and mapping between different styles of architecture references) can be maintained inside the `Makefile`
* Encapsulating that logic makes the CI YAML files considerably more readable
## Projects Using This
* [`insightful/alpine-node`](https://github.com/insightfulsystems/alpine-node)
* [`insightful/ubuntu-gambit`](https://github.com/insightfulsystems/ubuntu-gambit)
* [`insightful/ubuntu-gerbil`](https://github.com/insightfulsystems/ubuntu-gerbil)
## Caveats
* This does not cover multi-OS (Linux/Windows) images--the principles are the same, but that needs to split on the CI side to allow for different stages inside different VM agents.
* This only uses Docker Hub (and requires `DOCKER_USERNAME` and `DOCKER_PASSWORD` to be set as private global variables for the pipeline--I recommend using linked variables at the organization level).
* This does _not_ use the built-in Docker actions in Azure Pipelines (because they do not _yet_ support the experimental mode settings that are still required, as of June 2019, to build manifests).