The simple but annoying solution is to run sudo service docker start whenever you want to use Docker. One hiccup with docker in WSL2 is that it doesn't automatically start the Docker service. Stop before running sudo docker run hello-world.ĭon't want to have to run docker commands with sudo all the time? Follow this guide to add yourself to the docker group. Do package updates, install whatever tools and packages you want, and just generally make yourself at home.įollow these setup instructions (if you chose to install a distro other than Ubuntu, find the appropriate install guide on the left of that page). Now, open the "Ubuntu" application that you just got installed, and set your username and password. If you're having trouble upgrading the distro, see here for help. Make sure that the distro you just installed is a WSL2 distro, as you can't run docker in WSL1.Įnter fullscreen mode Exit fullscreen mode ![]() Make sure you install a WSL2 distro.įor the rest of this, I'm assuming you've installed the default Ubuntu Distro, steps might be slightly different for other distros. If that doesn't work, or you want to fiddle/customize/use a non-default distro, check out Microsoft's guide here. Nowadays, this should be as simple as Win+X, selecting (Admin), and running wsl -install. ![]() Here's the quick and dirty way to get that set up: Say you want to run a Linux environment on a Windows machine, and in that environment one of the things you want to do is make use of docker containers. But if you find yourself in a position where you can't or don't want to use the Docker Desktop support, read on. This obviates the need to install Docker within a WSL2 distro in most cases. ![]() Edit: It's come to my attention that, since I figured out this workaround back when WSL2 and thus Docker's WSL2 backend were new, Docker Desktop for Windows has added support for using Docker from within your WSL2 distro.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |