Add following parameters in /boot/cmdline.txt
cgroup_enable=memory cgroup_memory=1
for example editing with nano
sudo nano /boot/cmdline.txt
and reboot raspberry pi
sudo reboot
Now install docker
sudo apt-get update sudo apt-get dist-upgrade curl -sSL -o install.sh https://get.docker.com sh install.sh sudo usermod -aG docker pi
It makes sense to install Portainer for managing docker inside of a website http://raspberrypi.local:9000/
Installing Portainer can be done in docker itself (www.portainer.io)
docker volume create portainer_data docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
See official Images for supported architectures:
arm32v5 in theory all Raspberry Pi models
arm32v6 like Raspberry Pi Zero
arm32v7 like Raspberry Pi 3 or 4
arm64v8 like Raspberry Pi 4 in 64-bit mode
Old Images:
armhf in theory all Raspberry Pi models
Available Images on Balena:
https://www.balena.io/docs/runtime/resin-base-images/
Example running a web server on Raspberry Pi Zero W with the HTML files in /home/pi/html
docker pull arm32v6/nginx:alpine sudo docker run --name nginx -d -p 80:80 -v /home/pi/html:/usr/share/nginx/html:ro -d arm32v6/nginx:alpine