Docker in Practice, Second Edition
Ian Miell and Aidan Hobson Sayers
  • MEAP began June 2017
  • Publication in December 2017 (estimated)
  • ISBN 9781617294808
  • 425 pages (estimated)
  • printed in black & white


An eBook copy of the previous edition, Docker in Practice (First Edition), is included at no additional cost. It will be automatically added to your Manning Bookshelf within 24 hours of purchase.

Docker in Practice, Second Edition presents nearly 120 practical techniques, hand-picked to help you get the most out of Docker. Following a Problem/Solution/Discussion format, you'll walk through specific examples that you can use immediately, and you'll get expert guidance on general techniques you can apply to a whole range of scenarios. You'll tackle server maintenance, Swarm Mode, deployment, experimenting with your containers, and much more. Fully updated with newly-discovered techniques and interesting use cases, Docker in Practice, Second Edition is an essential resource that you'll want to have open on your desk!

"Must have guide to understanding, setup, and administering Docker!"

~ Alex Basil

"An essential read for DevOps transformers!"

~ Robert Kielty

"Great recipes style book for Docker."

~ Travis Wisnasky

Table of Contents detailed table of contents

Part 1: Docker fundamentals

1. Discovering Docker

1.1. The what and why of Docker

1.1.1. What is Docker?

1.1.2. What is Docker good for?

1.1.3. Key concepts

1.2. Building a Docker application

1.2.1. Ways to create a new Docker image

1.2.2. Writing a Dockerfile

1.2.3. Building a Docker image

1.2.4. Running a Docker container

1.2.5. Docker layering

1.3. Summary

2. Understanding Docker—inside the engine room

2.1. Docker’s architecture

2.2. The Docker daemon

2.2.1. TECHNIQUE n Open your Docker daemon to the world

2.2.2. TECHNIQUE n Running containers as daemons

2.2.3. TECHNIQUE n Moving Docker to a different partition

2.3. The Docker client

2.3.1. TECHNIQUE n Use socat to monitor Docker API traffic

2.3.2. TECHNIQUE n Using Docker in your browser

2.3.3. TECHNIQUE n Using ports to connect to containers

2.3.4. TECHNIQUE n Allowing container communication with user-defined networks

2.3.5. TECHNIQUE n Linking containers for port isolation

2.4. Docker registries

2.4.1. TECHNIQUE n Setting up a local Docker registry

2.5. The Docker Hub

2.5.1. TECHNIQUE n Finding and running a Docker image

2.6. Summary

Part 2: Docker and development

3. Using Docker as a lightweight virtual machine

3.1. From VM to container

3.1.1. TECHNIQUE n Converting your VM to a container

3.1.2. TECHNIQUE n A host-like container

3.1.3. TECHNIQUE n Splitting a system into microservice containers

3.1.4. TECHNIQUE n Managing the startup of your container’s services

3.2. Saving and restoring your work

3.2.1. TECHNIQUE n The "save game" approach to development—cheap source control

3.2.2. TECHNIQUE n Docker tagging

3.2.3. TECHNIQUE n Sharing images on the Docker Hub

3.2.4. TECHNIQUE n Referring to a specific image in builds

3.3. Environments as processes

3.3.1. TECHNIQUE n The "save game" approach to development

3.4. Summary

4. Building Images

4.1. Building images

4.1.1. TECHNIQUE n Injecting files into your image using ADD

4.1.2. TECHNIQUE n Rebuilding without the cache

4.1.3. TECHNIQUE n Busting the cache

4.1.4. TECHNIQUE n Intelligent cache-busting using build-args

4.1.5. TECHNIQUE n Intelligent cache-busting using the ADD directive

4.1.6. TECHNIQUE n Setting the Right Timezone in Your Containers

4.1.7. TECHNIQUE n Step Through Layers With the Image-Stepper

4.1.8. TECHNIQUE n Onbuild and Golang

4.2. Summary

5. Running Containers

5.1. Running containers

5.1.1. TECHNIQUE n Running GUIs within Docker

5.1.2. TECHNIQUE n Inspecting containers

5.1.3. TECHNIQUE n Cleanly killing containers

5.1.4. TECHNIQUE n Using Docker Machine to provision Docker hosts

5.1.5. TECHNIQUE Wildcard DNS

5.2. Volumes—a persistent problem

5.2.1. TECHNIQUE n Docker volumes—problems of persistence

5.2.2. TECHNIQUE n Distributed volumes with BitTorrent Sync

5.2.3. TECHNIQUE n Retain your container’s bash history

5.2.4. TECHNIQUE n Data containers

5.2.5. TECHNIQUE n Remote volume mounting using sshfs

5.2.6. TECHNIQUE n Sharing data over NFS

5.2.7. TECHNIQUE n Dev tools container

5.3. Summary

6. Day-to-day Docker

6.1. Staying ship-shape

6.1.1. TECHNIQUE n Running Docker without sudo

6.1.2. TECHNIQUE n Housekeeping containers

6.1.3. TECHNIQUE n Housekeeping volumes

6.1.4. TECHNIQUE n Detaching containers without stopping them

6.1.5. TECHNIQUE n Using Portainer to manage your Docker daemon

6.1.6. TECHNIQUE n Generate a dependency graph of your Docker images

6.1.7. TECHNIQUE n Direct action—​execute commands on your container

6.2. Summary

7. Configuration management—​getting your house in order

7.1. Configuration management and Dockerfiles

7.1.1. TECHNIQUE n Create reliable bespoke tools with ENTRYPOINT

7.1.2. TECHNIQUE n Avoid package drift by specifying versions in your build

7.1.3. TECHNIQUE n Replacing text with perl -p -i -e

7.1.4. TECHNIQUE n Flattening images

7.1.5. TECHNIQUE n Managing foreign packages with alien

7.2. Traditional configuration management tools with Docker

7.2.1. TECHNIQUE n Traditional: using make with Docker

7.2.2. TECHNIQUE n Building images with Chef Solo

7.3. Small is beautiful

7.3.1. TECHNIQUE n Tricks for making an image smaller

7.3.2. TECHNIQUE n Tiny Docker images with BusyBox and Alpine

7.3.3. TECHNIQUE n The Go model of minimal containers

7.3.4. TECHNIQUE n Using inotifywait to slim containers

7.3.5. TECHNIQUE n Big can be beautiful—​maybe monolithic is what you need?

7.4. Summary

Part 3: Docker and devops

8. Continuous integration: speeding up your development pipeline

8.1. Docker Hub automated builds

8.1.1. TECHNIQUE n Using the Docker Hub workflow

8.2. More efficient builds

8.2.1. TECHNIQUE n Speed up I/O-intensive builds with eatmydata

8.2.2. TECHNIQUE n Set up a package cache for faster builds

8.2.3. TECHNIQUE n Running Selenium tests inside Docker

8.3. Containerizing your CI process

8.3.1. TECHNIQUE n Running the Jenkins master within a Docker container

8.3.2. TECHNIQUE n Containing a complex development environment

8.3.3. TECHNIQUE n Scale your CI with Jenkins' Swarm plugin

8.3.4. Discussion

8.4. Summary

9. Continuous Delivery: a perfect fit for Docker principles

10. Networking Internals: harnessing the Docker virtual network

Part 4: Orchestration from machine to the cloud

11. Orchestration Primer

12. The Data Centre as an OS with Docker

13. Docker-based platforms

Part 5: Docker in production

14. Security

15. Plain Sailing: Docker in production and operational

16. Troubled Waters: Docker in production difficulties

About the Technology

Docker's simple idea, wrapping an application and its dependencies into a single deployable package, has continued to drive a revolution in software delivery. Docker is now the foundation of CI and CD pipelines, microservice systems, infrastructure automation, and countless innovative twists on the dev process. As well, Docker boasts an incredibly diverse and rich ecosystem, including Kubernetes, CoreOS, Mesos, OpenShift, and the 100,000+ images available on Docker Hub. The options are limitless; Docker in Practice is your guide to the ideas, techniques, and tools that give you the most return on your time.

What's inside

  • New techniques and the latest best practices
  • Continuous integration and delivery
  • Swarm Mode services and routing mesh
  • The Kubernetes orchestration tool
  • Streamlining your cloud workflow
  • Navigating the Docker ecosystem

About the reader

Written for developers and engineers using Docker in production.

About the authors

Ian Miell is the Lead OpenShift Architect at Barclays. Aidan Hobson Sayers is a developer at Hadean. Previously, they used Docker to transform DevOps at OpenBet.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $49.99 pBook + eBook + liveBook
MEAP eBook $39.99 pdf + ePub + kindle + liveBook

FREE domestic shipping on three or more pBooks