Book Image

Beginning DevOps with Docker

By : Joseph Muli
5 (1)
Book Image

Beginning DevOps with Docker

5 (1)
By: Joseph Muli

Overview of this book

Making sure that your application runs across different systems as intended is quickly becoming a standard development requirement. With Docker, you can ensure that what you build will behave the way you expect it to, regardless of where it's deployed. By guiding you through Docker from start to finish (from installation, to the Docker Registry, all the way through to working with Docker Swarms), we’ll equip you with the skills you need to migrate your workflow to Docker with complete confidence.
Table of Contents (7 chapters)

Using Docker Engine to Create a Swarm


Before we create our swarm, let's get a quick overview of the docker-machine cli. Typing docker-machine on your terminal should give you this output:

Just below that, we have our list of commands:

Note

Remember to always use the help option when you need to clarify something, that is, docker-machine stop --help

To create our first Docker Swarm cluster, we are going to use docker-machine to create our manager and worker nodes first.

Before creating the first machine, a quick overview of our objectives gives us the following: we are going to have four docker-machines, one manager, and three workers; they are all running on VirtualBox, thus there are four virtual machines.

Creating Docker Machines

This command is used to create a new virtual Docker host:

docker-machine create --driver <driver> <machine_name>

This means our Docker host will be running on VirtualBox, but managed and controlled by docker-machine. The --driver option specifies the driver...