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.

The hardware

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.

Operating System

And for the OS I’m going to use Armbian which is basically an Debian Strech, build for ARM processors.

Installing Docker

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.

Pre-installation steps

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.

Docker installation

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!


2 Comments

Jesse Stuart (@jesse_stuart) · April 20, 2018 at 7:09 am

> but there is still no standard 64 bit’s OS available like Raspbian or Armbian, so that’s why I’m using the ROCK64.

While I wholly agree the Rock64 is vastly Superior to the RPi, I do want to point out that there’s a Hypriot-based aarch64 distribution available: https://github.com/DieterReuter/image-builder-rpi64

I’ve been running this both to run “vanilla” docker as well as mini-nodes in a Kubernetes cluster alongside Rock64’s (in order to have a homogenously arm64 cluster), and have found it very stable; no issues with missing kernel modules or things like that.

Plus, being HypriotOS-based, it comes with the latest docker-ce package preinstalled — no messing with /etc/apt/sources[…] 🎉

    Remon Lam · April 24, 2018 at 7:20 am

    Hi Jesse, your right, there is a Hypriot ARM64 based distro, however I’ve experienced a couple of issues running this distro. Like a missing ETH0 device (but WiFi is working just fine), system unresponsiveness/kernel panic etc.
    I saw on Slack that Dieter is working on a solution for the ETC0 issue, so hopefully it’s fixed soon!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.