The three tools is now neatly packaged to what ' s called the Docker Toolbox.
Docker Machine
1/create Linux VMS
Docker-machine Create--driver VirtualBox containerhost
Or
Docker-machine create-d VirtualBox Local
2/open Docker VM ' s interface
Eval "$ (docker-machine env local)"
Or
Boot2docker Shellinit
3/stop VMS
Docker-machine Stop Containerhost
4/remove VMS
Docker-machine RM containerhost
Docker Compose
1/compose docker-compose.yml in Repository directory
2/docker-compose up
Docker Swarm
1/generate "Discovery token" (in VM)
Docker Run swarm Create
# The discovery token is actually created using Docker's public discovery service.
2/create Swarm Master (in host machine)
Docker-machine create-d VirtualBox--swarm--swarm-master--swarm-discovery token://yourtokenhere swarm-master
3/create Swarm nodes (in host machine)
Docker-machine create-d VirtualBox--swarm--swarm-discovery token://yourtokenhere swarm-agent-00
Docker-machine create-d VirtualBox--swarm--swarm-discovery token://yourtokenhere swarm-agent-01
4/shut down and remove ' local '
5/open Swarm Master Shell
Eval $ (docker-machine env--swarm swarm-master)
# Now we have a Swarm Master and the Swarm Nodes running locally,use ' Docker info ' to check
6/run Containers on cluster node
Docker run-d Redis
# 0d7af2492be35cc9c7593f6d677185c6c44f3a06898258585c7d2d2f9aa03c2e
Docker run-d Nginx
# 0babf055abf9b487b6bafd4651386075f8d6f46ce9f192849bc32345997438ea
7/list The containers scheduled on different clustered
Docker PS
Docker machine, Compose, and swarm:how they work Together