Prerequisites

  • One raspberry pi zero W
  • One sd card

Enable all cgroups

On you local linux, mount the partition containing alpine files.

In the cmdline.txt, add the following:

echo -ne " cgroup_enable=memory cgroup_enable=cpuset swapaccount=1" >> /run/media/youruser/xxx/cmdline.txt

Docker needs all cgroups enabled, so this will do the trick

On you rpi0

As simple as:

sudo apk add docker
sudo rc-update add docker boot
sudo rc-service docker start

To make sure your docker env doesn’t go in memory (512MB RAM won’t bring you far…), set it on mmcblk0p3 by editing /etc/docker/daemon.json:

{
        "exec-root": "/media/mmcblk0p3/var/run/docker",
        "data-root": "/media/mmcblk0p3/var/lib/docker",
        "no-new-privileges": false
}

and restart the service:

sudo rc-service docker restart
docker run --rm hypriot/armhf-hello-world

You should see some text if everything is working