Book Image

Docker Deep Dive

By : Nigel Poulton
Book Image

Docker Deep Dive

By: Nigel Poulton

Overview of this book

A new version of this book is now available. Most applications, even the funky cloud-native microservices ones, need high-performance, production-grade infrastructure to run on. Having impeccable knowledge of Docker will help you thrive in the modern cloud-first world. With this book, you will gain the skills you need in order to work with Docker and its containers. The book begins with an introduction to containers and explains their functionality and application in the real world. You will then get an overview of VMware, Kubernetes, and Docker and learn to install Docker on Windows, Mac, and Linux. Once you have understood the Ops and Dev perspective of Docker, you will be able to see the big picture and understand what Docker exactly does. The book then turns its attention to the more technical aspects, guiding you through practical exercises covering Docker engine, Docker images, and Docker containers. You will learn techniques for containerizing an app, deploying apps with Docker Compose, and managing cloud-native applications with Swarm. You will also build Docker networks and Docker overlay networks and handle applications that write persistent data. Finally, you will deploy apps with Docker stacks and secure your Docker environment. By the end of this book, you will be well-versed in Docker and containers and have developed the skills to create, deploy, and run applications on the cloud.
Table of Contents (3 chapters)

7: Containers

Now that we know a bit about images, it’s time to get into containers. As this is a book about Docker, we’ll be talking specifically about Docker containers. However, Docker implements the image and container specs published by the Open Container Initiative (OCI) at https://www.opencontainers.org. This means a lot of what you learn here will apply to other container runtimes that are OCI compliant. Also, the things you’ll learn will help you if you need to learn and use Kubernetes.

We’ll split this chapter into the usual three parts:

  • The TLDR
  • The deep dive
  • The commands

Docker containers - The TLDR

A container is the runtime instance of an image. In the same way that you can start a virtual machine (VM) from a virtual machine template, you start one or more containers from a single image. The big difference between a VM and a container is that containers are faster and more lightweight — instead of running a full-blown OS like...