Start a conversation

Docker on Arm

Tips for running Docker containers on Packet's c1.large.arm server.

What is docker?

 Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.

What specs does the c1.large.arm have?

On our platform this would be the c1.large.arm. This server is equipped with 96 physical cores @ 2.0 GHz (dual Cavium ThunderX ARMv8 processors), 128Gb of DDR4 RAM, 340 GB of SSD storage, and a bonded 20Gbps network.   

How do you install Docker?

It is suggested to install Ubuntu 16.x c1.large.arm. A few tools you may want to install to help you along: 

apt-get install -y jq expect kvm

Starting with 17.07(?) there are pre-built binaries on the testing channel. The instructions are loosely based on these instructions.

apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Add arm64 testing
add-apt-repository \
   "deb [arch=arm64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   test"
apt-get update
apt-get install -y docker-ce

Adding a new user

New users are added to the docker and kvm group and optionally to the sudo group

USER=rneugeba
adduser $USER # or adduser --disabled-password $USER
usermod -aG docker $USER
usermod -aG kvm $USER
usermod -aG sudo $USER

Install other tools needed for LinuxKit

Install notary (for signing)

There are no prebuild arm64 binaries to building from source

git clone git@github.com:docker/notary.git && cd notary
git checkout v0.5.0
docker run --rm -ti -v $(pwd):/go/src/github.com/docker/notary arm64v8/debian:stretch
# then in the container
export GOPATH=/go
apt-get update && apt-get install -y libltdl-dev golang-go git make
cd /go/src/github.com/docker/notary/
make client
exit
# now install the binary
cp ./bin/notary /usr/bin

Install password manager CLI like lastpass (optional)

This needs to be compiled from source as well and needs the following packages:

apt-get install -y openssl libcurl4-openssl-dev libxml2 libssl-dev libxml2-dev pinentry-curses xclip cmake build-essential pkg-config

Then, download the latest release from github and unpack and make

Update qemu

The version of qemu/kvm which comes with 16.04 is quite old. So we install a newer version from source=

apt-get install -y automake libglib2.0-dev bison flex
wget http://download.qemu-project.org/qemu-2.10.0-rc1.tar.xz
tar xvJf qemu-2.10.0-rc1.tar.xz
cd qemu-2.10.0-rc1
./configure
make

Deploying your first container

docker run --rm -it aarch64/hello-world

Unable to find image 'aarch64/hello-world:latest' locallylatest: Pulling from aarch64/hello-world8c5c4ac25476: Pull completeDigest: sha256:bd1722550b97668b23ede297abf824d4855f4d9f600dab7b4db1a963dae7ec9eStatus: Downloaded newer image for aarch64/hello-world:latestHello from Docker on arm64!This message shows that your installation appears to be working correctly.

Containers for ARMv8 (aarch64)

Docker containers by default contain binaries for Intel systems. To run Docker on ARMv8, you need a source for containers based on the ARMv8 architecture. You can either run these from a Docker repository, build your own containers based off of base images, or use a prepacked image that runs on multiple architectures.

aarch64/*

A good source for this is the aarch64 account on Docker Hub. This account adapts the official amd64 set of containers to run on ARMv8 systems. These base containers have languages, operating systems, and databases upon which you can build you own images.


Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Golden Prifti

  2. Posted

Comments