4 ms·
Note that Docker Desktop and Docker Engine are separate products. Docker Desktop is the desktop application package that makes Docker user-friendly on macOS and
by dharmab 5y ago
Note that Docker Desktop and Docker Engine are separate products. Docker Desktop is the desktop application package that makes Docker user-friendly on macOS and Windows. Docker Engine, the container runtime itself, remains free:
> No changes to Docker Engine or any upstream open source Docker or Moby project.
If you develop on Linux, no changes are needed.
- arsfeld 5y agoHow 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.
- alanwreath 5y agoNot a trivial thing to run Docker natively inside of a WSL2 environment - at least my attempts to install straight docker strictly inside Ubuntu running in WSL2 always resulted in Ubuntu’s attempts to reach some .exe with regard to Docker. I did learn some fun facts WRT Linux in WSL2 - it doesn’t have systemd installed by default.
- spooneybarger 5y agoI've never had a problem with it. I've been using docker engine in WSL2 for a couple years. I install `docker.io` via apt and its good to go except that package has on some ubuntu versions been missing the /etc/init.d/ startup script. I build my WSL2 environments via Dockerfile. You can see everything here: https://github.com/SeanTAllen/wsl-environments/tree/main/ubuntu-20-daily https://github.com/SeanTAllen/wsl-environments/tree/main/ubu... Using that dockerfile I can then export the file system as a tar (https://wiki.seantallen.com/notes/docker-export-filesystem/ https://wiki.seantallen.com/notes/docker-export-filesystem/) and import into wsl using the wsl import command.
- naikrovek 5y agowell the installation process seems to have changed in the last 2 years. installing `docker.io` is not enough to get docker running in WSL 2 anymore.
- ldavison 5y agoI was able to get podman setup in WSL2 pretty easily following this: https://www.redhat.com/sysadmin/podman-windows-wsl2 https://www.redhat.com/sysadmin/podman-windows-wsl2