Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
I have been searching the internet since yesterday how to fix it but all I found was to stop and start the service with systemctl, and change ownership of /var/run/docker.sock
I would appreciate it if someone can help me solving this issue.
After 3 days of hassle I figured it out.
When I checked the network configuration with ifconfig, I didn’t see docker0 bridge. Somehow, after update & upgrade it was deleted. I added it manually and now my docker works fine.
This seems to be happening to quite a few people on Jetpack 6.0 DP after upgrading docker. See this thread:
I also don’t see the docker0 bridge. When I sudo systemctl restart docker.service I get Job for docker.service failed because the control process exited with error code
What is the best way to manually add the docker0 bridge back?
I agree that the error messages from jornalctl indicate that the bridge is the problem. However I don’t know how the bridge was initially set up. Is there someone here who can give a simple epxlanation on how to bring the bridge back to life. Netplan? Network-Manager?
sudo apt-get install bridge-utils
sudo brctl addbr docker0
sudo ip addr add 10.1.0.1/24 dev docker0
sudo ip link set dev docker0 up
ip addr show docker0
sudo systemctl restart docker
sudo iptables -t nat -L -n
It did not work, below is the output from each command:
jetson@jetson-desktop:~$ sudo apt-get install bridge-utils
[sudo] password for jetson:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
bridge-utils is already the newest version (1.7-1ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
jetson@jetson-desktop:~$ sudo brctl addbr docker0
jetson@jetson-desktop:~$ sudo ip addr add 10.1.0.1/24 dev docker0
jetson@jetson-desktop:~$ sudo ip link set dev docker0 up
jetson@jetson-desktop:~$ ip addr show docker0
8: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 9a:83:ad:8c:96:c5 brd ff:ff:ff:ff:ff:ff
inet 10.1.0.1/24 scope global docker0
valid_lft forever preferred_lft forever
jetson@jetson-desktop:~$ sudo systemctl restart docker
Job for docker.service failed because the control process exited with error code.
See “systemctl status docker.service” and “journalctl -xeu docker.service” for details.
jetson@jetson-desktop:~$ sudo iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
My bridge (before any updates) says 172.17.0.1/16. Is this randomly assigned as I see it is different to yours.
I thought a bridge had to be linked to either the physical ethernet or wifi connector?
I did the same, ran all the bridge commands and when I check the status of docker.service it is still down. When I ran sudo journalctl -u docker.service
I get error obtaining controller instance: failed to register "bridge" driver
same problem with a newly flashed and installed AGX Orin, solved with downgrading iptables to the legacy version (instead of the newer nftables) update-alternatives --set iptables /usr/sbin/iptables-legacy
then apt reinstall docker-ce which manages to create the necessary bridge and iptables rules