Installing Docker on a ARM64 device
Installing Docker on devices with a ARM processors is not that complicated these days. For most devices there’s a Operating System that will met most or all of the requirements for running Docker and even Docker itself will run on most CPU architectures.
Before we are going to install Docker, we need to have hardware that will have a ARM64 processor. In this case I’m using the ROCK64, this device comes with the following specs;
- Rockchip RK3328 Quad-Core (1,5 GHz) ARM Cortex A53 64-Bit Processor
- 4GB (there’s also a 1GB and 2GB model) 1600MHz LPDDR3 memory
- eMMC module socket
- USB 3.0 port
- 1 Gb networking
I could have used the Raspberry Pi 3B+ because the CPU is 64 bit capable, but there is still no standard 64 bit’s OS available like Raspbian or Armbian, so that’s why I’m using the ROCK64.
The first thing we need to do is checking the CPU architecture, this can be done with the uname command, with the -m option you only see the CPU architecture;
uname -m aarch64
So in this case the machine is running aarch64 (that’s ARM64), so we are good to go for the next steps.
Because I’m using Debian, I’m able to use the Docker supplied repositories, this makes installing Docker a bit easier.
The first task is to install the required packages and configure the Docker repository.
Lets start with installing the packages.
$ sudo apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg2 \ software-properties-common
Once the packages have been installed the next step is to add the Docker GPG key.
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
The next step is to add the Docker repository.
$ echo "deb [arch=arm64] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | \ sudo tee /etc/apt/sources.list.d/docker.list
In the docs there is nothing mentioned of ARM64 support, however when looking over at the docker download site it shows there are arm64 packages, so make sure that the arch is set to arm64.
Tell the system there is a new repository available we need run a update command
$ sudo apt-get update
When running the update command you should see there are two Docker repositories added to the repo list.
NOTE: it’s only required to run a update and not the upgrade command 😉
Once all the previous commands have been run succesfully, it’s time to install Docker!
$ sudo apt-get install -y docker-ce
Great Docker has been installed, now the final step is to check if it’s running as arm64.
$ docker version
This should show you an output that consist of two parts; one is the Docker Client and one is the Docker Engine, both should show arm64 at the OS/Arch section.
$ docker version Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:10:06 2018 OS/Arch: linux/arm64 Experimental: false Orchestrator: swarm Server: Engine: Version: 18.03.0-ce API version: 1.37 (minimum version 1.12) Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:08:10 2018 OS/Arch: linux/arm64 Experimental: false
Great everything is installed and running with ARM64 support.
Lets try to start a Alpine container.
$ docker run -it alpine sh $ exit
And run the command to check what CPU architecture it’s running.
$ docker run -it alpine uname -a Linux 25a56793ced4 4.16.0-rc6-rk3328 #10 SMP Sat Mar 31 14:02:39 CEST 2018 aarch64 Linux
As you can see it’s running as aarch64, so the container itself running as arm64…. yeah!
That’s it.. happy Dockering!