Wednesday, July 13, 2016

Running Docker on Pine64

In the beginning of this year I backed the Kickstarter for Pine64. The Pine64 is an interesting little board with a quad core All-Winner 64-bit CPU, lots of IO, a gigabit network interface and up to 2GB memory.
And that for a price less than the latest Raspberry Pi 3, starting at just $15 up to $29 for the 2GB version.

Almost 2 weeks ago I received the 5 Pine64's from my pledge. Unfortunately I was not able to do anything with them till last weekend.
Recently the site was launched with lots of info about the board and how to get started.
I started out with the latest DebianBase image, but that did not seem to work. The board did not start properly somehow. The DebianMate image did work though, but it is quite big and also has a UI which I do not need. I was quite a hassle to figure out how to disable the LightDM UI.
For those interested in knowing how:
$ systemctl get-default
// will show it's current status is ''.
// to disable ui it must be set to ''.
$ systemctl get-default
$ reboot
Then I had an issue with the screen resolution on my Eizo display, but that was solved changing the screen size on the monitor itself.
If you'd like to adjust the resolution of the Pine, you can do so in the /boot/uEnv.txt file. Default it is set to '720p60', but you can change it to '1080p60', '1920x1080p' or '1080p50'. For more info about setting the resolution see Linux Sunxi Display or here in the code for all supported resolutions.

After the initial boot and upgrade of the packages, I checked whether the GoLang was available since Docker is build in Go. It was, and it installs.
Then I checked out Docker. It is available in the '' package, but unfortunately it does not install. I then looked into how to build Docker myself on a armv7, but that's quite a hassle since it seems you need Docker to build a new Docker. :-/
And Etcd, which is needed by Kubernetes which is my ultimate goal to run in the Pine, is also not available for Debian but that one is easy to build yourself.

Yesterday I tried out the UbuntuBase image since it is much smaller than the DebianMate (160MB compared to 1.2Gb).
This Ubuntu version does have GoLang and Etcd and Docker packages available. And they all work!

After installing them, I wanted to verify Docker really works. I was a bit of a search to find a BusyBox image for armhf, but finally found Container4armhf on the Docker hub which provides one.
Then, running
$ docker run container4armhf/armhf-busybox echo "Hello Docker on Pine64"
prints 'Hello Docker on Pine64". It works! :-D

Another option is to run:
$ docker run armv7/armhf-ubuntu echo "Hello from armv7 ubuntu"
which also prints out the echo string.

So ... Docker on the Pine64 works. Great!
Next steps will be to try to install Kubernetes to run on the Pine64 and try to build a cluster out of all the pines.