3 ms·
How would that work if you're using WSL? Docker for Desktop uses WSL but creates it's own separate VM (if you can call it a VM). Would I be able to install and
by arsfeld 5y ago
How would that work if you're using WSL? Docker for Desktop uses WSL but creates it's own separate VM (if you can call it a VM).
Would I be able to install and run Docker inside Ubuntu's WSL distro to avoid paying for Docker for Desktop?
- easton 5y agoYes, but you'd have to connect the Docker CLI running in Windows to the engine inside Ubuntu (not hard), and then you wouldn't be able to mount stuff in Windows into Docker containers via relative paths (you'd have to start them with /mnt/c/...). If neither of those things matter for you (like if all of your project code is inside your WSL VM), then it's totally fine.
- mishafb 5y agoYou probably can, there's nothing about containers that shouldn't work on WSL2
- dharmab 5y agoYou could configure Docker Engine in Ubuntu to expose a network socket, and configure Docker CLI in Windows WSL to use that network socket: https://wiki.archlinux.org/title/Docker#Daemon_socket https://wiki.archlinux.org/title/Docker#Daemon_socket
- raesene9 5y agoYou can connect to a remote Docker engine instance over SSH, which is easier to setup than exposing the Docker socket over a TCP port. So install the client inside WSL and the engine on a Linux VM. EDIT: https://raesene.github.io/blog/2018/11/11/Docker-18-09-SSH/ https://raesene.github.io/blog/2018/11/11/Docker-18-09-SSH/ was a blog I wrote when that feature landed, AFAIK it works the same way now :)
- JoyrexJ9 5y agoI do all my work under WSL, and run Docker engine in WSL and it works perfectly. 100% headless. I may have had to expose the Docker socket for VS Code containers support to work, but that wasn't any pain, and secured with TLS. Never needed Docker Desktop, which seemed like a bloated mess.
- maple3142 5y agoEnable WSL2, then you can just install the docker provided by your distro package manager. For example, I am using docker packaed by Arch Linux, and it works as expected. If you need to use `docker` command under Powershell, maybe exposing docker socket to Windows host would probably work. I didn't try it as I don't need it.