Installing Docker machine-5 minutes a day to play Docker container technology (45)

Source: Internet
Author: User
Tags web services docker machine

In front of our experimental environment there is only one Docker host, and all the containers are running on this host. However, in a real environment there will be multiple hosts, where containers are started, run, stopped, and destroyed, and related containers communicate with each other over the network, regardless of whether they are located in the same host.

How do we manage this multi-host environment effectively?
The first problem we faced was installing and configuring Docker for all hosts.

In front of us, we manually installed the first Docker host, including the following steps:

    1. Install the HTTPS CA certificate

    2. Add GPG Key

    3. Add Docker apt Source

    4. Installing Docker

Visible step is still quite a lot of, for multi-host environment manual way inefficient and not easy to ensure consistency, for this problem, Docker solution is the Docker machine.

Docker machine allows you to install and configure Docker host in batches, which can be local virtual machines, physical machines, or cloud hosts in a public cloud.

Docker machine supports installing and configuring Docker host in different environments, including:

    1. General Linux Operating System

    2. Virtualization platform-VirtualBox, VMWare, Hyper-V

    3. OpenStack

    4. Public cloud-Amazon Web Services, Microsoft Azure, Google Compute Engine, Digital Ocean, and more

Docker Machine has a unified name for these environments: provider. For a particular provider,docker machine, install and configure the Docker host with the appropriate driver, as shown in:


Here we study Docker machine through experiments.

Experimental environment Description

There are three host hosts running Ubuntu in the lab environment.

We will install Docker machine on the 192.168.56.101 and then deploy Docker on the other two hosts through the Docker-machine command.

Installing Docker Machine

Official installation documentation at https://docs.docker.com/machine/install-machine/

The installation method is simple and executes the following command:

curl-l https://github.com/docker/machine/releases/download/v0.9.0/docker-machine-' uname-s '-' uname-m ' >/ Tmp/docker-machine &&

chmod +x/tmp/docker-machine &&

sudo cp/tmp/docker-machine/usr/local/bin/docker-machine


The downloaded execution file is put into/usr/local/bin, and the docker-mahine version Validation command is available:

> Note: When you see this article, the Docker machine should have an updated version, which can be installed by reference to the official documentation.

  via tab   key completion   docker-mahine   's subcommands and parameters. The installation method is downloaded from Https://github.com/docker/machine/tree/master/contrib/completion/bash completion script:

place it in   /ETC/BASH_COMPLETION.D   directory. Then add the following code to $HOME/.BASHRC :

ps1= ' [\[email protected]\h \w$ (__docker_machine_ps1)]\$ '

The effect is to set the command-line prompt for docker-machine, but wait until the other two hosts are deployed to see the effect.

The Docker machine is ready and the current environment is as follows:

In the next section we learn how to create machine.

Installing Docker machine-5 minutes a day to play Docker container technology (45)

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.