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...