So I had problems install Docker on an RPI 4, using the usual routes caused hassle and issues, so I went on a mission to fix it!
Here are the steps:
It turns out the installed iptables is kind of broken, so it needs to be re-installed correctly.
sudo apt purge iptables
sudo apt install iptables -y
Once thats complete, we need to reboot the machine to load all the kernal modules.
sudo reboot
Next; to the fun part, lets download the binaries!
wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/containerd.io_1.2.6-3_armhf.deb
wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/docker-ce-cli_19.03.1~3-0~debian-buster_armhf.deb
wget https://download.docker.com/linux/debian/dists/buster/pool/stable/armhf/docker-ce_19.03.1~3-0~debian-buster_armhf.deb
Now, lets install the binaries!
sudo dpkg -i containerd.io_1.2.6-3_armhf.deb
sudo dpkg -i docker-ce-cli_19.03.1~3-0~debian-buster_armhf.deb
Why didn't I install docker-ce? It turns out the ExecStart for the package is a bit broken, so we need to patch it before install!
sudo mkdir -p /etc/systemd/system/docker.service.d/
sudo cat <<EOT >> /etc/systemd/system/docker.service.d/hosts.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2736
EOT
Once that is done, then we can install docker proper.
sudo dpkg -i docker-ce_19.03.1~3-0~debian-buster_armhf.deb
If you want to test it just run
sudo docker run hello-world
Enjoy!!!