Docker machine, Compose, and swarm:how they work Together

Source: Internet
Author: User
Tags eval docker ps docker compose docker run docker swarm docker toolbox docker machine

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.