August 2020 Update: now that VMware Workstation can run with Hyper-V installed, there's a better alternative to running Docker on Windows 10. Check out this guide for more information.
Docker is one of the most useful tools for a developer nowadays, but setting it up on a Windows machine can be really painful, specially if you don't want to enable Hyper-V and prefer to use another hypervisor such as VMware Workstation.
Fortunately, there's an "easy" way to do exactly that with Chocolatey, the self-proclaimed package manager for Windows. Let's get started!
First of all, we need to open a Powershell window with administrative privileges and run the following command to install the Docker CLI and the VMware Docker machine driver:
PS> choco install docker-cli docker-machine-vmware
As Docker is runtime-agnostic, we can create a custom Docker machine running inside a VMware VM instead of using Hyper-V and then connect that instance to the Docker CLI. Let's create the Docker machine:
PS> docker-machine create --driver=vmware default
This command will take a few minutes. After it's done, make sure it was successful by listing the available Docker machines:
PS> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - vmware Running tcp://192.168.142.136:2376 v19.03.5
Great, we're almost done! The final step is to tell the CLI to use this machine for any Docker-related commands:
PS> docker-machine env | Invoke-Expression
And that's it! Docker running on Windows using VMware Workstation instead of Hyper-V. Keep in mind you'll need to start the Docker machine and connect it to Docker CLI every time you boot your device:
PS> docker-machine start default; docker-machine env | Invoke-Expression
Last but not least, here are some relevant URLs you can visit to learn more:
Top comments (0)