You must use Docker Toolbox to run docker on Windows 10 home. There is a native Docker for Windows Pro, Enterprise or Education. It runs natively on *nix.
I ran into a few quirks setting up Docker and VirtualBox on my Windows Home PC. Here are some tips.
Install Docker on Windows Home
Follow instructions there to install docker.
Using Docker with Windows PowerShell
Once your docker machine is running you can access it with MINGW or Power Shell. In order to use Power Shell we need to load the environment variables, which are loaded by default in MINGW.
Open MINGW and type:
docker-machine env default --shell powershell
It should return output similar to this:
$Env:DOCKER_TLS_VERIFY = "1" $Env:DOCKER_HOST = "tcp://192.168.99.100:2376" $Env:DOCKER_CERT_PATH = "C:\Users\kellie\.docker\machine\machines\default" $Env:DOCKER_MACHINE_NAME = "default" # Run this command to configure your shell: # C:\Program Files\Docker Toolbox\docker-machine.exe env --shell=powershell default | Invoke-Expression
Paste the last line from the above output into PowerShell
& 'C:\Program Files\Docker Toolbox\docker-machine.exe' env --shell=powershell default | Invoke-Expression
Confirm it worked by typing the following in PowerShell
Full documentation is available on Docker’s site.
Mounting Volumes in MINGW
MINGW Posix Conversion shows how MINGW converts filepaths when typed into the terminal. When mounting a volume in MINGW you should put a double forward slash in front of the entire filepath section of the command like this:
docker run —name my–mysql –v //c/Users/me/Documents/my/volume/path:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=xxxxx -d mysql:latest
You must also make sure that the filepath you use is set up as a shared folder in VirtualBox. Docker automatically sets c:/Users as a shared folder. You can add others in the VirtualBox interface.
Using Bash in Powershell
MINGW does not work properly with the -t (TTY) option. Right now it seems the best workaround is to use Powershell instead. In a Powershell terminal type:
docker exec -it container_name //bin/bash