Help! Docker Won't Start on My Raspberry Pi
Asked by
canyon_walk
I've been using Docker on various devices without issues, but I'm having trouble on my Raspberry Pi 4B. After following the official installation instructions, everything seemed fine, but now when I try to run any Docker command, I get an error saying: `docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?` When I check the status with `systemctl status docker`, I see messages indicating it failed to start: 'docker.service: Failed with result 'exit-code'.' The `journalctl -u docker.service` log shows that there's a problem with initializing the network controller. I recently cloned the SD card to a USB drive for firmware updates and booted from it. Could this affect Docker? I've tried uninstalling and reinstalling Docker and even reinstalled the modules, but nothing seems to work. Any solutions?
Answers
Looks like there could be a kernel-level mismatch here. If rebooting hasn't worked, you should try forcing Docker to use the legacy version of iptables. You can do this by running:
```
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
```
Let me know if that helps!
Reply to this answer
You might need to reboot after a kernel upgrade. There can be situations where the system just doesn't apply the updates until a reboot happens.
Reply to this answer
Are you running Debian on the Raspberry Pi? It might help to check that since some users had similar issues when using incompatible distributions.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions