Ubuntu 22.04 and Docker
I followed the instruction from DigitalOcean to install Docker and Docker Compose on Ubuntu 22.04. However, when trying to run docker run hello-world
, I received the following error:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
This was due to Ubuntu 22.04 having issues with iptables. To resolve this, I had to switch it back to legacy version.
- Update the iptables and set it back to
iptables-legacy
.sudo update-alternatives --config iptables
- Restart docker service.
sudo service docker start
- Confirm that docker is running.
sudo service docker status