Foreword
Who is this book for?
A note about versions
Credits and Acknowledgments
Technical Reviewers
Scott Collier
John Ferlito
Pris Nasrat
Technical Illustrator
Proofreader
Author
Conventions in the book
Code and Examples
Colophon
Errata
Version
Introduction
Introducing Docker
An easy and lightweight way to model reality
A logical segregation of duties
Fast, efficient development life cycle
Encourages service oriented architecture
Docker components
Docker client and server
Docker images
Registries
Containers
Compose, Swarm and Kubernetes
What can you use Docker for?
Docker with configuration management
Docker's technical components
What's in the book?
Docker resources
Installing Docker
Requirements
Installing on Ubuntu and Debian
Checking for prerequisites
Installing Docker
Docker and UFW
Installing on Red Hat and family
Checking for prerequisites
Installing Docker
Starting the Docker daemon on the Red Hat family
Docker for Mac
Installing Docker for Mac
Testing Docker for Mac
Docker for Windows installation
Installing Docker for Windows
Testing Docker for Windows
Using Docker on OSX and Windows with this book
Docker installation script
Binary installation
The Docker daemon
Configuring the Docker daemon
Checking that the Docker daemon is running
Upgrading Docker
Docker user interfaces
Summary
Getting Started with Docker
Ensuring Docker is ready
Running our first container
Working with our first container
Container naming
Starting a stopped container
Attaching to a container
Creating daemonized containers
Seeing what's happening inside our container
Docker log drivers
Inspecting the container's processes
Docker statistics
Running a process inside an already running container
Stopping a daemonized container
Automatic container restarts
Finding out more about our container
Deleting a container
Summary
Working with Docker images and repositories
What is a Docker image?
Listing Docker images
Pulling images
Searching for images
Building our own images
Creating a Docker Hub account
Using Docker commit to create images
Building images with a Dockerfile
Building the image from our Dockerfile
What happens if an instruction fails?
Dockerfiles and the build cache
Using the build cache for templating
Viewing our new image
Launching a container from our new image
Dockerfile instructions
Pushing images to the Docker Hub
Automated Builds
Deleting an image
Running your own Docker registry
Running a registry from a container
Testing the new registry
Alternative Indexes
Quay
Summary
Testing with Docker
Using Docker to test a static website
An initial Dockerfile for the Sample website
Building our Sample website and Nginx image
Building containers from our Sample website and Nginx image
Editing our website
Using Docker to build and test a web application
Building our Sinatra application
Creating our Sinatra container
Extending our Sinatra application to use Redis
Connecting our Sinatra application to the Redis container
Docker internal networking
Docker networking
Connecting containers summary
Using Docker for continuous integration
Build a Jenkins and Docker server
Create a new Jenkins job
Running our Jenkins job
Next steps with our Jenkins job
Summary of our Jenkins setup
Multi-configuration Jenkins
Create a multi-configuration job
Testing our multi-configuration job
Summary of our multi-configuration Jenkins
Other alternatives
Drone
Shippable
Summary
Building services with Docker
Building our first application
The Jekyll base image
Building the Jekyll base image
The Apache image
Building the Jekyll Apache image
Launching our Jekyll site
Updating our Jekyll site
Backing up our Jekyll volume
Extending our Jekyll website example
Building a Java application server with Docker
A WAR file fetcher
Fetching a WAR file
Our Tomcat 7 application server
Running our WAR file
Building on top of our Tomcat application server
A multi-container application stack
The Node.js image
The Redis base image
The Redis primary image
The Redis replica image
Creating our Redis back-end cluster
Creating our Node container
Capturing our application logs
Summary of our Node stack
Managing Docker containers without SSH
Summary
Docker Orchestration and Service Discovery
Docker Compose
Installing Docker Compose
Getting our sample application
The docker-compose.yml file
Running Compose
Using Compose
Compose in summary
Consul, Service Discovery and Docker
Building a Consul image
Testing a Consul container locally
Running a Consul cluster in Docker
Starting the Consul bootstrap node
Starting the remaining nodes
Running a distributed service with Consul in Docker
Docker Swarm
Understanding the Swarm
Installing Swarm
Setting up a Swarm
Running a service on your Swarm
Orchestration alternatives and components
Fleet and etcd
Kubernetes
Apache Mesos
Helios
Centurion
Summary
Using the Docker API
The Docker APIs
First steps with the Engine API
Testing the Docker Engine API
Managing images with the API
Managing containers with the API
Improving the TProv application
Authenticating the Docker Engine API
Create a Certificate Authority
Create a server certificate signing request and key
Configuring the Docker daemon
Creating a client certificate and key
Configuring our Docker client for authentication
Summary
Getting help and extending Docker
Getting help
The Docker forums
Docker on IRC
Docker on GitHub
Reporting issues for Docker
Setting up a build environment
Install Docker
Install source and build tools
Check out the source
Contributing to the documentation
Build the environment
Running the tests
Use Docker inside our development environment
Submitting a pull request
Merge approval and maintainers
Summary
List of Figures
List of Listings
Index