Book Image

Learning Docker Networking

By : Rajdeep Dua, Vaibhav Kohli, Santosh Kumar Konduri
Book Image

Learning Docker Networking

By: Rajdeep Dua, Vaibhav Kohli, Santosh Kumar Konduri

Overview of this book

<p>Docker is a Linux container implementation that enables the creation of light weight portable development and production environments. These environments can be updated incrementally. Docker achieves this by leveraging containment principles like cgroups and Linux namespaces along with Overlay filesystem based portable images. Docker provides the networking primitives that allow administrators to specify how different containers network with each application and connect each of its components, then distribute them across a large number of servers and ensure coordination between them irrespective of the host or VM they are running in.</p> <p>This book will show you how to create, deploy, and manage a virtual network for connecting containers spanning single or multiple hosts.</p>
Table of Contents (13 chapters)
Learning Docker Networking
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Overlay network with Docker Machine and Docker Swarm


This section explains the basics of creating a multi-host network. The Docker Engine supports multi-host networking through the overlay network driver. Overlay drivers need the following pre-requisites to work:

  • 3.16 Linux kernel or higher

  • Access to a key-value store

  • Docker supports the following key-value stores: Consul, etcd, and ZooKeeper

  • A cluster of hosts connected to the key-value store

  • Docker Engine daemon on each host in the cluster

This example uses Docker Machine and Docker Swarm to create the multi-network host.

Docker Machine is used to create the key-value store server and the cluster. The cluster created is a Docker Swarm cluster.

The following diagram explains how three VMs are set up using Docker Machine:

Prerequisites

  • Vagrant

  • Docker Engine

  • Docker Machine

  • Docker Swarm

Key-value store installation

An overlay network requires a key-value store. The key-value store stores information about the network state such as discovery, networks, endpoints...