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.
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
“`
LikeLike
Glad to help!
LikeLiked by 1 person
sudo adduser $USER docker
LikeLike
In the meantime the get.docker.com script works on Raspberry Pi Zero again, the depending containerd now works out of the box on ARMv6 machines.
For the hello-world example you could run the underlying image with
docker run arm32v5/hello-world
There is an issue with the manifest lists (multi-arch images) when they don’t contain an exact matching CPU variant.
LikeLiked by 1 person
Hey Stefan,
So to be clear, is the Raspberry Pi Zero compatible with docker (even though it uses the older armv6l architecture)? I’ve read multiple Github reports saying it does NOT support the issue.
I know when I run it, using the Docker install script, and then trying to run the Hello-World container, I get the following output:
pi@rpi-dev:~ $ docker run -it hello-world
failed to resize tty, using default size
Which sounds just may be a limitation to the Raspberry Pi Zero / 1B+ models using the older architecture. Thoughts?
LikeLike