How to install docker on a Raspberry Pi Zero W running Raspbian Buster

I’m currently working on a fun side project involving 5 Raspberry Pis and an arduino (a stupidly long post about that coming in the future, fear not) and I’ve run into an issue on both my Raspberry Pi 2 and my Raspberry Pi Zero W when trying to get docker working.

What’s the problem?

Well, I am no expert on these things, but essentially the Pi 2 and the Zero run an older processor, ARM6 types to be precise. The issue when you try to install docker using their excellent one liner, it barfs right at the end with a failure…. this seems to be caused by one of the packages that docker requires (containerd.io) not liking these older arm processors… but it used to run fine.

What’s the solution?

Pretty simple.. use an older version of containerd.

How do I do that?

Glad you asked. Pretty simple. (Assuming you have your pi setup correctly with buster, and all the packages up to date)

To start, run the basic docker install script

sudo curl -sL get.docker.com | bash

This will spit out an error at the end. Fear not.

Huge shout out to github user michalng for the solution he helped me out with here.

Basically, you need to go back, overwrite the containerd install with an updated (yet older) version. (I’ve added in the sudos as that’s the way I need to run this on my fairly vanilla pi install)

cd /tmp
wget https://packagecloud.io/Hypriot/rpi/packages/raspbian/buster/containerd.io_1.2.6-1_armhf.deb/download.deb
sudo dpkg -i download.deb
sudo rm download.deb
sudo systemctl restart docker

And one last step… don’t forget to add your current user (in my instance “pi”) into the docker group, so you don’t’ need to sudo everything

sudo usermod -a -G docker pi

Now, restart your pi so all these changes can take effect

sudo shutdown -r now

… and once it boots back up, you should be able to run docker normally, try it out with

 docker --version

One final note here…. I usually test docker with hello-world

docker run hello-world

For whatever reason, this image doesn’t work on ARM6 pis.. I haven’t dug into it much, as the image I needed worked fine. But be aware if you try to run that and it barfs (or as in my case, just exits with no output) don’t worry, other images should work fine.

2 thoughts on “How to install docker on a Raspberry Pi Zero W running Raspbian Buster

Add yours

  1. Thanks! This summary helped me a lot!

    > `docker run hello-world`
    >
    > For whatever reason, this image doesn’t work on ARM6 pis.

    Try,

    “`
    $ docker run hypriot/armhf-hello-world
    “`

    I found out that the `hello-world` image tag on Docker Hub doesn’t contain an image for ARMv6. But contains for ARMv7 image tho.

    F.Y.I. There’s an official repo for ARMv6: https://hub.docker.com/u/arm32v6

    To pull an Alpine Linux image it will be:

    “`
    $ docker pull arm32v6/alpine
    “`

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: