Docker Machine Overview

A list,

Docker Machine is a tool.

With this tool you can:

  • inMacorWindowsInstall and run onDocker
  • Configure and manage multiple remotesDockerThe host
  • provideSwarmThe cluster

2, preparation,

  1. Windows system
  2. Has been installedgit-bash
  3. Has been installedOracle VM virtualBox

Three, installation,

  1. Open thegit-bash
  2. Run the following command
if[[!-d "$HOME/bin"]].then mkdir -p "$HOME/bin"; fi&& \ curl - L > https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-Windows-x86_64.exe"$HOME/bin/docker-machine.exe" && \
chmod +x "$HOME/bin/docker-machine.exe"
Copy the code

Three, use,

The command instructions
active View the current active statusDockerThe host
config View activeDockerHost connection information
create To create aDockerThe host
inspect In order tojsonFormat output specificationDockerDetails about the host
ip Gets the specifiedDockerThe host address
kill Directly kill the designatedDockerThe host
ls List all managed hosts
restart Restart the specifiedDockerThe host
rm To delete a tableDockerHost: The corresponding VM will be deleted
scp inDockerBetween hosts andDockerBetween the host and the localscpCommand to copy files remotely
ssh Use SSH to connect to the host and run the command
start Starts a specifiedDockerThe host. If the object is a VIRTUAL machine, the VIRTUAL machine will be started
status Access to specifyDockerHost Status
stop To stop aDockerThe host
upgrade Will specify the hostDockerThe version is updated to the latest
url Gets the listening URL of the specified Docker host

Fourth, the sample

4.1 create

$ docker-machine.exe create --driver=virtualbox test

4.2 the connection

docker-machine.exe ssh test

4.3 stop

docker-machine.exe stop test