CHAPTER 7
The Docker Ecosystem: Tools
7.0 Introduction
Docker in itself is extremely powerful and you now have covered all the topics to get
you to a new way of writing distributed applications. However, Docker is even more
powerful because of its large and vibrant ecosystem. This chapter presents a large set
of tools in the Docker ecosystem.
To get started in this ecosystem we cover some tools that also come from Docker, Inc.
If you have installed the Docker toolbox described in the
first chapter you will have
those tools already installed. Otherwise, each recipe shows you how to install them
separately. First we show you how to use
docker-compose
in
Recipe 7.1
. Compose is
way to describe a multicontainer application in a single YAML file. We look at our
first
example in this book, WordPress, and describe a compose file that allows you to
run a WordPress site with two containers. We extend our look at Compose with a
more complex example that shows you how to deploy a single-node
Mesos
cluster in
Recipe 7.2
. After Compose,
we introduce Swarm in
Recipe 7.3
. A cluster manager for
Docker, Swarm allows you to expose several Docker hosts behind a single Docker
API endpoint. From the client side everything looks identical to a single-host setup,
but Swarm can manage multiple hosts and schedule the containers on them. In
Recipe 7.4
, we illustrate how you can easily create your own Docker swarm cluster
using
docker-machine
, which we introduced in the first chapter. This has the nice
twist that you can use
docker-machine
to create multiple
Docker hosts in a public
cloud and configure them automatically as a Swarm cluster. To wrap up the list of
Docker, Inc. tools, we give a brief introduction to Kitematic, the Docker desktop user
interface, in
Recipe 7.5
.
Aside from Docker Inc., a large number of projects make up the Docker ecosystem,
and the rest of the chapter presents a few of them. First, a basic web interface to
193
Docker
is presented in
Recipe 7.6
, then an interactive shell based on
docker-py
is
shown in
Recipe 7.7
. System administrators who are familiar with configuration
management will find
Recipe 7.8
interesting; it shows how you can use Ansible to
manage the deployment of your containers using an Ansible playbook.
An area of great interest is container orchestrators. Docker Swarm,
which we cover in
this chapter, is an example of container orchestrator, but there exist many.
Recipe 7.9
introduces Rancher, an orchestrator that has very interesting capabilities like multi-
data-center networking, load-balancing and an integration with Docker Compose.
CloudFoundry Lattice is introduced in
Recipe 7.10
. It is a great way to start learning
how Cloudfoundry treats microservices applications and is Docker compatible. We
also
dive deeper into Mesos, with a single-node Mesos sandbox example in
Recipe
7.11
and a cluster setup shown in
Recipe 7.12
.
To wrap up this chapter we present a self-discovery mechanism based on
registra
tor
in
Recipe 7.13
. With a large number of ephemeral containers running on a clus‐
ter, you want to have a system that detects these containers and registers them in a
data store. This data store can then be queried to locate services and make sure your
application keeps on running. Some of the orchestrators
presented earlier in the
chapter offer a discovery mechanism, but if you have to build your own, using
regis
trator
is a good solution.
Do'stlaringiz bilan baham: