Table of Content
download docker toolbox for win
https://www.docker.com/products/docker-toolbox
- install to default location
- copy docker.exe, docker-machine.exe, docker-compose.exe to your cygwin /usr/local/bin
- uninstall docker toolbox for win
docker toolbox setting
1) make junction (directory hard link) for "Program Files", it will make easy to find VirtualBox tools
mklink /j C:\Program_Files "C:\Program Files" Junction created for C:\Program_Files > C:\Program Files mklink /j C:\Program_Files_x86 "C:\Program Files (x86)" Junction created for C:\Program_Files_x86 > C:\Program Files (x86)
2) place VirtualBox path in customized cygwin profile portabledevops_cygwin.sh under /etc/profile.d/
# portable docker toolbox for cygwin export VBOX_MSI_INSTALL_PATH=/cygdrive/c/Program_Files/Oracle/VirtualBox/ export PATH=$VBOX_MSI_INSTALL_PATH:$PATH alias dm=/usr/local/bin/docker-machine.exe alias dc=/usr/local/bin/docker-compose.exe denv(){ eval $(docker-machine env "$@") } export -f denv
docker test
1) create new docker machine
$ dm create --driver virtualbox --virtualbox-hostonly-cidr "10.0.10.1/24" cygdemo $ dm start cygdemo
2) setup env for docker client access
$ denv cygdemo denv only supports one machine, 0 or 2+ will get error as below: $ denv Error: No machine name(s) specified and no "default" machine exists. $ denv a b Error: Expected one machine name as an argument
3) docker client test
$ docker ps -a $ docker info $ docker run -it hello-world
4) ssh to docker vm
$ dm ssh cygdemo