Docker for windows on VMware, dockervmware
Work Environment
Operating System: Windows 10 Pro x64
Hyper-V: uninstalled.
VMware: installed.
Virtual Box: no installation.
Preface
In view of Hyper-V's "weak chicken" performance in Windows desktop systems, including not limited to "hot chicken" in the "network" aspect, a variety of reasons for incompatibility.
I decided to (disable/uninstall) Hyper-V, but I didn't want to use its default Virtual Box. So I changed it to my favorite VMware Workstation and used it as the driver for Docker machine.
The above is just a personal experience of the three virtual machines, and may not have fully understood their advantages. Please do not try it. Thank you for your advice.
Docker does not yet support the VMware Workstation driver, but I found third-party support: https://docs.docker.com/machine/drivers from the official Docker documentation
Body
Third-party support for access to the driver, https://github.com/pecigonzalo/docker-machine-vmwareworkstation/releases/latest
Download the binary file -- docker-machine-driver-vmwareworkstation.exe, and copy it to the same directory of docker-machine.exe,Note: If you are
1. copy the Files installed through InstallDocker. msi to C: \ Program Files \ Docker \ resources \ bin.
2. copy the Files installed by dockertoolbox.exe to C: \ Program Files \ Docker Toolbox.
2.1if dockertoolbox.exe is installed, you must modify the C: \ Program Files \ Docker Toolbox \ start. sh script file:
#!/bin/bashexport PATH="$PATH:/mnt/c/Program Files (x86)/VMware/VMware Workstation"trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong in step ´$STEP´... Press any key to continue..."' EXITVM=${DOCKER_MACHINE_NAME-default}DOCKER_MACHINE=./docker-machine.exeBLUE='\033[1;34m'GREEN='\033[0;32m'NC='\033[0m'if [ ! -f "${DOCKER_MACHINE}" ]; then echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again." exit 1fivmrun.exe list | grep \""${VM}"\" &> /dev/nullVM_EXISTS_CODE=$?set -eSTEP="Checking if machine $VM exists"if [ $VM_EXISTS_CODE -eq 1 ]; then "${DOCKER_MACHINE}" rm -f "${VM}" &> /dev/null || : rm -rf ~/.docker/machine/machines/"${VM}" #set proxy variables if they exists if [ -n ${HTTP_PROXY+x} ]; then PROXY_ENV="$PROXY_ENV --engine-env HTTP_PROXY=$HTTP_PROXY" fi if [ -n ${HTTPS_PROXY+x} ]; then PROXY_ENV="$PROXY_ENV --engine-env HTTPS_PROXY=$HTTPS_PROXY" fi if [ -n ${NO_PROXY+x} ]; then PROXY_ENV="$PROXY_ENV --engine-env NO_PROXY=$NO_PROXY" fi "${DOCKER_MACHINE}" create -d vmwareworkstation $PROXY_ENV "${VM}"fiSTEP="Checking status on $VM"VM_STATUS="$(${DOCKER_MACHINE} status ${VM} 2>&1)"if [ "${VM_STATUS}" != "Running" ]; then "${DOCKER_MACHINE}" start "${VM}" yes | "${DOCKER_MACHINE}" regenerate-certs "${VM}"fiSTEP="Setting env"eval "$(${DOCKER_MACHINE} env --shell=bash ${VM})"STEP="Finalize"clearcat << EOF ## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/EOFecho -e "${BLUE}docker${NC} is configured to use the ${GREEN}${VM}${NC} machine with IP ${GREEN}$(${DOCKER_MACHINE} ip ${VM})${NC}"echo "For help getting started, check out the docs at https://docs.docker.com"echocddocker () { MSYS_NO_PATHCONV=1 docker.exe "$@"}export -f dockerif [ $# -eq 0 ]; then echo "Start interactive shell" exec "$BASH" --login -ielse echo "Start shell with command" exec "$BASH" -c "$*"fi
3. OpenGit-bash, Enter the following command:
3.1.Docker-machine ls
Check whether a machine instance exists. If yes, consider uninstalling it.
3.2.Docker-machine stop dev & docker-machine rm dev
Pause and uninstall the machine instance named dev. The dev here is different from each other, which may be default or others. For details, refer to the data listed in the docker-machine ls command.
3.2.1.Docker-machine create -- driver = vmwareworkstation dev
Create a machine instance named dev.
3.2.2. Of course, if you do Step 2.1, you can also do step 3.2.1.
Instead, you can find a blue Docker command line icon named "Docker Quickstart Terminal" on your desktop.
And double-click to run it.
When you run it for the first time, you will check whether you have created an instance named "default". If yes, you can directly start the command operation interface. If no, this will help you create and initialize an instance named "default", and the active instance is the default instance.
When there is a default machine instance, all the operations you perform through the docker command are performed on the default instance.
3.3.Docker-machine ls
View the instance list. Here, you can view the instance status information, including version, IP address, and name.
3.4.Eval "$ (docker-machine env dev)" & docker-machine active
The two commands can be executed separately or simultaneously in the same shell window.
Eval "$ (docker-machine env dev)" means to load the environment variable of the machine instance named "dev" to the current shell window.
Docker-machine active is used to obtain the name of the machine instance to be activated from the environment variable loaded in the previous sentence and activate it.
Activate the specified machine instance as the default instance. One docker can only have one activated default instance.
3.5.Docker-machine ssh dev
After connecting to the machine instance, you can use the docker command to perform any supported operations...
For example, docker push and pull ....
PS: If you have performed step 3.2.2 or Step 3.4, you do not need to perform step 3.5.
You can directly use the docker command to normally use docker development.
References
Https://docs.docker.com/machine/get-started
Https://github.com/pecigonzalo/docker-machine-vmwareworkstation
Http://www.cnblogs.com/yjmyzz/p/docker-machine-using-vmware.html
Download resource Summary
InstallDocker. msi: https://download.docker.com/win/stable/InstallDocker.msi
DockerToolbox.exe: https://download.docker.com/win/stable/DockerToolbox.exe
: Https://github.com/docker/toolbox/releases/latest
Boot2docker. iso: https://github.com/boot2docker/boot2docker/releases/latest
Docker-machine-driver-vmwareworkstation.exe: https://github.com/pecigonzalo/docker-machine-vmwareworkstation/releases/latest