Table of Content
Docker Toolbox for Windows
is tool set for both docker machine and docker client:
- docker-machine
- docker
portable docker for windows
Here is solution to make it portable with USB driver, precondition:
- portable msys + Git
- portable Cmder/Console2
1) First for all, install Docker Toolbox for Windows without VirtualBox and Git options since I already have them.
2) Then copy "Docker Toolbox" folder to portable path like:
"drive":\"portablepath"\DockerToolbox
and uninstall Docker Toolbox from Windows.
3) add USERPROFILE to msys /etc/profile since Docker Toolbox will create virtual machine under working space .docker as below:
$USERPROFILE\.docker\machine\machines\default
so add this line to /etc/profile,
export USERPROFILE=/home/username
4) add docker setup in /etc/profile
# docker toolbox export DOCKERTOOLBOX=/"portablepath"/DockerToolbox export PATH=$PATH:$DOCKERTOOLBOX
5) start Cmder/Console2 then launch msys bash terminal,
Cmder: start Cmder then start msys bash from CLI or task tab %ConEmuDir%\..\..\..\msys\bin\bash --login -i Console2: start Console2 then start msys bash from CLI or tab "drive":\"portablepath"\msys\bin\bash.exe --login -i
$ dockerstart Creating CA: "drive":\"portablepath"\msys\home\"username"\.docker\machine\certs\ca.pem Creating client certificate: "drive":\"portablepath"\msys\home\"username"\.docker\machine\certs\cert.pem Running pre-create checks... (default) Image cache directory does not exist, creating it at "drive":\"portablepath"\msys\home\"username"\.docker\machine\cache... (default) No default Boot2Docker ISO found locally, downloading the latest release... (default) Latest release for github.com/boot2docker/boot2docker is v1.11.2 (default) Downloading "drive":\"portablepath"\msys\home\"username"\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.11.2/boot2docker.iso... (default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100% Creating machine... (default) Copying "drive":\"portablepath"\msys\home\"username"\.docker\machine\cache\boot2docker.iso to "drive":\"portablepath"\msys\home\"username"\.docker\machine\machines\default\boot2docker.iso... (default) Creating VirtualBox VM... (default) Creating SSH key... (default) Starting the VM... (default) Check network to re-create if needed... (default) Waiting for an IP... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with boot2docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: "drive":\"portablepath"\Docker Toolbox\docker-machine.exe env default ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ docker is configured to use the default machine with IP 192.168.99.105 For help getting started, check out the docs at https://docs.docker.com Start interactive shell $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES $ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default * virtualbox Running tcp://192.168.99.105:2376 v1.11.2
6) how to stop/start docker machine
docker-machine status default docker-machine stop default docker-machine start default