$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Happiness!
$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Saddness!
You installed Rancher Desktop, and you have setup Ubuntu on your WSL2 environment and then you go to try some docker things and it is not working.
$ type docker
docker is hashed (/mnt/c/Program Files/Rancher Desktop/resources/resources/linux/bin/docker)
But you see sadness.
$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Rancher Desktop > Main Window > Preferences > WSL > Integrations (Tab)
-
Expose Rancher Desktop's Kubernetes configuration and Docker socket to Windows Subsystem for LInux (WSL) distros
-
Ubuntu
Hit that check box as fast as you can, and you are off to the races! Hope that helps.