Normally builds on drone.io are executed on x86, x64.
In some case, you want to run build on other architecture.
Drone now supports arm and arm64 from v0.8.
The ARM is used Raspberry Pi, Mobile Devices such as Android, and IoT devices as well. To introducing CI/CD into the development of embedded device like this is very important.
This article describes introducing arm architecture build on drone.io.
Introducing ARM agent
Although ARM architecture is now supported by drone.io, you need to run drone server on x64. If you have already the server, use it.
If you want to build with ARM, setup agent in ARM environment. Raspberry Pi is an easy way to make agent by installing docker, also qemu virtualization is available. Agent images are provided for arm and arm64 environment. There are tags including linux-arm, linux-arm64. Finally, you need to set DOCKER_ARCH=arm as an environment variable as follows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
drone-agent: | |
image: drone/agent:linux-arm | |
command: agent | |
restart: always | |
volumes: | |
– /var/run/docker.sock:/var/run/docker.sock | |
environment: | |
– DRONE_SERVER=127.0.0.1:9000 | |
– DRONE_SECRET=00e40bfb287a0a553c80297a | |
– DOCKER_ARCH=arm |
ARM .drone.yml
If build starts on this condition, drone server is not to able to detect the architecture, and cannot select the suitable agent to run. To specify the architecture, add the platform to .drone.yml as follows.
You can mix the multi-architecture agents under the one server because the agent will be chosen by drone server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
platform: linux/arm | |
pipeline: | |
build: | |
image: arm32v7/busybox:latest | |
commands: | |
– uname -a |
When build running…
+ uname -a Linux 39737a2a3d25 4.13.9-300.fc27.armv7hl #1 SMP Mon Oct 23 15:02:20 UTC 2017 armv7l GNU/Linux
on armv7, yeah!
ARM build requires ARM docker images. Officially ARM-based images are provided on docker hub, so you can customize these images.
ARM Plugins
There is a note to use ARM build. ARM build requires ARM version of the plugins. Almost official drone plugins provide support for ARM, however, your own plugin should rebuild image on ARM.
Could you give an example of how someone might accomplish multiarch building with Drone.io using QEMU?