[Yannick Pipke](https://unsplash.com/@joker2000) on
[Unsplash](https://unsplash.com/s/photos/cpu)
---
In the last days I worked on a suitable setup for a [Drone CI](https://drone.io/) server to support multi-arch builds. While the setup for common x86 Drone runners is easy, working with setups for ARM, especially ARM32, is a bit tricky. The easiest way would be to have native servers of the respective architecture available. However, it's difficult to find hosting offers for ARM at all - for ARM32 this seems almost impossible. I decided to use Amazon EC2 ARM64 servers, they are relatively cheap and can also be used as a private customer.
<!--more-->
But how do you turn an ARM64 server into an ARM32 server? Basic requirement is an ARMv8 CPU. This type supports (in most cases) both `AArch32` and `AArch64`. The first step is to enable multi-arch support on your operating system. I use Ubuntu 18.10 for this setup:
```Shell
dpkg --add-architecture armhf
```
Then add the Docker CE repository for ARM32 and install the packages:
To use the right architecture within Docker containers you still have to force the Docker daemon into ARM32 mode. This can be accomplished by two systemd overwrites:
That's it. Don't forget to reload and restart the systemd daemon:
```Shell
systemctl, daemon reload
systemctl, restart, docker
```
What you get is a Docker daemon that runs in ARM32 mode. This can be used for example to start a Golang container and build apps without cross-compile.
root@ip-10-0-225-151:~# docker run alpine uname -a
Linux dbad5ddeb5ea 5.3.0-1035-aws #37-Ubuntu SMP Sun Sep 6 01:17:41 UTC 2020 armv8l Linux
{{</highlight>}}
<!-- spellchecker-enable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
Just a word of warning. I'm not a hardware specialist and there might be some situations where this setup does not work. Furthermore it seems that some operating systems have problems to recognize `armv8l` as ARM32 architecture. For OpenSuse as an example I had to force `zypper` into `armv7hl` mode to get it working. After this step building ARM32 OpenSuse Docker images also works for me.
```Shell
sed -i 's/# arch = s390/arch = armv7hl/g' /etc/zypp/zypp.conf
```
If you want to give it a try, I've prepared a minimal Cloud-Init configuration:
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- spellchecker-disable -->
{{<highlightyaml"linenos=table">}}
#cloud-config
apt_reboot_if_required: false
package_update: true
package_upgrade: true
bootcmd:
- [ dpkg, --add-architecture, armhf ]
apt:
sources:
docker.list:
source: deb [arch=armhf] https://download.docker.com/linux/ubuntu $RELEASE stable