with apologies

Docker Docker

Richard Mortier · May 06, 2017 · #old #docker #arm64

Bootstrapping Docker for ARM64 (aka AARCH64)

Basic process is:

Instructions below are for CentOS 7 for Reasons(tm). Package details and so on will vary on other distros.

Build go bootstrap toolchain

On x86 host:

cd
curl -O https://storage.googleapis.com/golang/go1.4-bootstrap-20161024.tar.gz
tar xzvf go1.4-bootstrap-20161024.tar.gz
mv go go1.4
cd go1.4/src
./make.bash
mkdir -p ~/go/src
cd ~/go/src
git clone https://go.googlesource.com/go
cd go
git checkout go1.7.5
cd src
GOOS=linux GOARCH=arm64 ./bootstrap.bash
scp ~/go/src/go-linux-arm64-bootstrap.tbz HOST:~

Build ARM64 go1.7.5

cd
tar xvf go-linux-arm64-bootstrap.tbz
mkdir -p ~/go/src
cd ~/go/src
git clone https://go.googlesource.com/go
cd go
git checkout go1.7.5
cd src
GOROOT_BOOTSTRAP=~/go-linux-arm64-bootstrap ./make.bash
mv ~/go/src/go/bin ~/go/bin

Bootstrap ARM64 Docker

sudo yum remove git
wget https://github.com/git/git/archive/v2.12.2.tar.gz
tar xvf v2.12.2.tar.gz
cd git-*
which git
sudo yum install perl-devel hg curl-devel
make configure
./configure --prefix=/usr/local
make -j8
sudo make install
sudo yum install btrfs-progs-devel device-mapper-devel
cd ~/go
mkdir -p src/github.com/docker
cd src/github.com/docker
git clone git@github.com:docker/docker
cd docker
git co v1.10.3
( cd vendor && for n in src/* ; do ln -s $n ; done )
./hack/make.sh dynbinary
rm -rf vendor && git checkout . # tidy up symlinking

Note that a current bug in Ubuntu packaging metadata means a small edit needs to be made to ./Dockerfile.aarch64: change the apt-get update && to apt-get update ; so that the build doesn’t stop at the first hurdle, updating packages.

# sudo rm -rf /var/lib/docker /etc/docker/config.json # DANGEROUS!
sudo ./bundles/1.10.3/dynbinary/docker daemon -D --group=wheel
$ PATH=$(pwd -P)/bundles/1.10.3/dynbinary/:$PATH
$ docker version
Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.7.5
 Git commit:   20f81dde9
 Built:        Tue Apr  4 00:27:13 2017
 OS/Arch:      linux/arm64

Server:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.7.5
 Git commit:   20f81dde9
 Built:        Tue Apr  4 00:27:13 2017
 OS/Arch:      linux/arm64

Build Docker

export DOCKER_BUILDTAGS='apparmor selinux seccomp'
git co v17.05.0-ce # or v1.12.3 or master or whatever
make          # transient failure of first build; restart succeeded
make deb
mkdir contrib/builder/rpm/aarch64
make rpm

Notes