Review: The Docker Book by James Turnbull

It is hard to avoid Docker. Hacker News has been abuzz with it for years, The Register ran an exhaustive feature about it a couple of months ago; indeed it seems to have taken over the DevOps world.

But why do I care? I am a developer, I live in the land of abstractions. The JVM is as low as I go my friends.

The problem is, all developers need to do releases.. And releases have a tendency to go very wrong..

Docker_Releases

So, I decided to educate myself. What is it about Docker that has got the cool kids on Hacker News all excited?

I took a look at some Youtube videos, tried out the tutorials and read a handful of blog posts and how-tos on Docker. I just couldn’t get my head around it! Finally I took the plunge and spent the last couple of weeks working through James Turnbull’s The Docker Book.

So, am I enlightened? The short answer is – yes, I have enjoyed working my way through the “Docker Book” and I have a much better idea on how to use Docker and the sort of use cases it is designed for.

The book is written in a tutorial format. We start with the basics about Docker and containers and move on to installing Docker on your favoured Linux(1) distribution.

Once we have Docker up and running, we learn about the basics of Docker. How containers can be created from images and how these images can layered. We learn about the Docker repository can be used to download standard images (for example, the image for ubuntu:14.04 can be used to build a base container that runs Ubuntu 14.04 LTS) and how to build containers from the images that we define. The author walks us through setting up and managing some simple containers.

All the Dockerfiles and any scripts and code used in the examples is readily available from the Github repository that the author has setup for the book(2).

I suspect most readers will get the most value out of chapters 6 and 7 of the book. Here the author goes through some examples including:

  • Using Docker to build a test environment
  • Building a continous integration pipeline using Jenkins and Docker
  • Building a web application that is deployed on multiple containers

These examples are quite detailed and well designed. Most of them could be used as a basis for a Docker based application stack “in the real world”.

Chapter 8 explores the eco-system(3) that is being build up around Docker focusing on service discovery with Consul and orchestration with Fig.

The book concludes with chapters on the Docker API and how Docker can be extended.

“The Docker Book” does not go into details on how containers work beyond the introductory chapters. The focus of the book is about learning what you can do with Docker and it succeeds admirably. I deducted half a star from the review simply because the author does not delve much into things like performance implications of using Docker or on how exactly the operating system may allocate resources to applications running in containers. There are plenty of resources online on these topics4.

You can’t go wrong with “The Docker Book” if you are looking for a hand-on introduction to Docker. James Turnbull is a good tutor and the resources accompanying the book are great.

Will Docker solve my release woes? Is it actually ready to be deployed in a corporate setting? Perhaps a topic for another post..

My Rating: 4.5 out of 5

Notes:

  1. Instructions for use of Docker on Windows and MacOSX are provided but are skeletal. Basically you need to use Boot2Docker
  2. I worked through almost every single example from the Kindle edition and didn’t find a buggy script or typo!
  3. The eco-system is moving fast. Kubernetes from Google is also worth checking out.
  4. The Docker blog is excellent