Running Docker inside Ubuntu with WSL2 on Windows 10
Enable Docker for Ubuntu on Windows via WSL2:
Go to Docker Desktop > Settings > Resources > WSL IntegrationMake sure you have “Enable integration with my default WSL distro” selected and also turn on each distro.
Now you can launch Ubuntu and without even installing “docker” in Ubuntu you should be able to run the “docker” command:
$ docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES7b5806fcd967 vsc-vscode-remote-try-java-7082d7a76a508a754975227521a1e638 "/bin/sh -c 'echo Co…" 5 days ago Exited (255) 2 minutes ago exciting_shamir6ea30d1e64d4 vsc-vscode-dockers-8f87a2becb47231eb8a5f3a96484679c "/bin/sh -c 'echo Co…" 5 days ago Exited (0) 5 days ago lucid_noyce
Docker uses WSL2 for its virtualization. Docker is just another distro that runs on top of WSL Linux’s kernel.
> wsl -l
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
docker-desktop-data
docker-desktop
Comments
Post a Comment