In addition to what was already said, I would like to share with you some issues that I had while setting up and the solutions that eventually allowed me to start working with a WSL2/Docker Desktop combo.
This is not a complete guide, just another source of troubleshooting!
My goal was
- Start Experimenting with Docker.
- Setup my environment so it is as recommended and most comfortable.
- Basically to be able to work in a Linux Context while working with Docker Desktop.
How I went about it
- I upgraded my PC from Win 10 Home to Win 10 Pro, to avoid various issues I read that people were having with the Home edition.
- I had Docker Toolbox installed and then deleted it as well as the Oracle VM install I had on my PC. I had various small issues, read online that it's best to remove Oracle VM as well.
- I installed Docker Desktop.
Issues and their solutions
1. A few of the environment variables from the old Docker Tools installation remained.
This caused Docker Desktop to misbehave.
Solution: I deleted all of them. (Any variable name that mentioned Docker)
2. When trying to connect to Docker on localhost:2375 via Ubuntu WSL2 got the famous "...is docker even running" error.
Worth mentioning that on cmd docker was working properly at this stage.
Solution:
- Purge a previous installation of Docker I had on my Ubuntu WSL2.
- Make sure to delete all and any environment variables that mentioned Docker on my ubuntu WSL2.
- Stop Hyper-v, Rebooted, Started Hyper-V Rebooted on Windows.
- Install the latest version of Docker via `apt-get`.
Now running on Ubuntu WSL2 "docker context ls" to check my setup should result in:
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
Running Docker Info from Ubuntu WSL2:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.5.0-docker)
scan: Docker Scan (Docker Inc., v0.5.0)
Server:
Containers: 3
Running: 0
Paused: 0
Stopped: 3
Images: 3...