- Install docker on windows – But to use docker-machine, you do not need to run docker in windows pc
- Virtualbox should be preinstalled in windows machine
- Create a docker host0
- docker-machine create -d virtualbox host0
- Create a docker host1
- docker-machine create -d virtualbox host1
- See host0’s environment info
- docker-machine env
- SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.101:2376
SET DOCKER_CERT_PATH=C:\Users\kushana\.docker\machine\machines\host0
SET DOCKER_MACHINE_NAME=host0
SET COMPOSE_CONVERT_WINDOWS_PATHS=true
REM Run this command to configure your shell:
REM @FOR /f “tokens=*” %i IN (‘docker-machine env host0’) DO @%i
- Connect to host0, execute following in windows command prompt
- @FOR /f “tokens=*” %i IN (‘docker-machine env host0’) DO @%i
- Disconnect from host 0
- docker-machine env -u
- SET DOCKER_TLS_VERIFY=
SET DOCKER_HOST=
SET DOCKER_CERT_PATH=
SET DOCKER_MACHINE_NAME=
REM Run this command to configure your shell:
REM @FOR /f “tokens=*” %i IN (‘docker-machine env -u’) DO @%i - Execute this in cmd @FOR /f “tokens=*” %i IN (‘docker-machine env host0’) DO @%i