I've recently installed Ubuntu 22.04 WSL on my Windows 10 PC.
My naive understanding is that this Ubuntu "app" is equivalent to a Linux development environment.
When I explore within the running Ubuntu app, it generally feels like the normal Linux I'm accustomed to: the shell appears to be bash
, and I have access to executables like git
, curl
, man
, etc.
Trusting this claim that this Ubuntu WSL is equivalent to a Linux development environment, I now want to run Docker in this Ubuntu instance.
My naive understanding is that "since Linux natively supports containers, I should install Docker Engine" on Linux.
So I followed the steps described here: https://docs.docker.com/engine/install/ubuntu/
But when I try to verify that Docker Engine is installed correctly by running the hello-world image, I get the following error:
$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
There is no /var/run/docker.sock
and I don't think the Docker daemon is running:
$ ls -l /var/run/docker.sock
ls: cannot access '/var/run/docker.sock': No such file or directory
$ ps aux | grep containerd
user 10212 0.0 0.0 8164 732 pts/2 S+ 21:44 0:00 grep --color=auto containerd
Can someone please help me understand what has gone wrong, and if there is corrective action I can take to successfully install Docker in this Ubuntu WSL app on my Windows PC?
Perhaps are the instructions at https://docs.docker.com/engine/install/ubuntu/ only meant for "Ubuntu natively installed on a host PC" and not for Ubuntu WSL running on a Windows PC?
If so, then is there some other way I should be "installing Docker" so that Docker commands like sudo docker run hello-world
can be run from within my Ubuntu WSL?
I'm quite confused by all the layers of software involved here.
wsl -l -v
. // WSL does not use service manager, so it won't start services like the Docker Daemon. Check a WSL-targeted guide.