Sean P. Kane
For my mom, who got me to read, and my dad, who read to me.
And for my wife and daughters, who are my bedrock.
Foreword
Containers are ubiquitous. From local development, to continuous integration, to managing large-scale production workloads, containers are everywhere. Why did this come about, where is it going, and what do you, the reader, need to know about this revolution that has taken over our industry?
Many older technologies offer the promise of write once, run anywhere. However, not all runtimes offered this facility, and even those that did still required the runtime (and any additional dependencies) to be available in order for an application to run. Containers offer the promise of build once, run anywhere. They allow you to package your applications, the runtime required to run it, configuration files, and any and all file dependencies it needs into one artifact. As long as you have a container runtime on the target machine, your application just works. This allows your infrastructure to be truly application agnostic. It works on my machine, begone!
Containers offer a standard application programming interface (API) to manage the lifecycle of a container and the applications packaged within the container. This API provides a homogenous interface to an otherwise heterogeneous deployment landscape, relieving operations teams from having to know the nitty-gritty of deploying and running applications and, consequently, being able to focus on the what they do bestmanaging infrastructure, enforcing security and compliance, and keeping the lights on.
This interface also forms the basis for a ton of innovation. Container orchestrators like Kubernetes and Nomad leverage this control plane to raise the level of abstraction, making it easier to manage containerized workflows at scale. Service mesh technologies, like Istio, work hand in glove with orchestrators, decoupling cross-cutting concerns like service discovery and security from the application stack.
All the benefits of a standard interface also flow upstream, making the daily lives of developers easier. A single command can produce an entire development environment. Within continuous integration (CI), containers can be easily spun up to house databases, queues, or whatever dependencies your application needs to allow for integration, smoke, and end-to-end tests to check and verify your work. And finally, the portability of containers allows development teams to take ownership of their work in production, making many facets of DevOps a reality.
In a world where runtimes upgrade major versions regularly, teams and organizations are polyglot, DevOps practices like blue-green and canary releases are the norm, and scale is unprecedented, the technology that teams throughout the world are using to build and deploy their applications is containers. Containers are no longer new or novelrather, they represent the rule of how organizations are packaging and deploying applications.
However, working with containers isnt easy. Having used containers for almost a decade, and having spent time teaching it to audiences around the world, I can attest to how nuanced this subject is.
Sean and Karl have distilled years of experience into a highly readable, yet comprehensive guide to using containers with Docker. Everything you need to get started and be productive with Docker can be found within the pages of this bookfrom installation, to understanding how to use and build images, to working with containers, introspecting builds and the runtime, as well as productionizing containers, can be all found here.
And thats not allSean and Karl arent afraid to dive into microscopic detailselaborating on how simple Linux primitives like cgroups and namespaces make this magical thing called containers a reality. Finally, the Docker ecosystem is ever growing and expandingand youll find coverage on that landscape as well.
In the foreword of Docker: Up & Running, second edition, Laura Tacho made an astute observationcloud native technologies like VMs and containers are not exclusive. Rather, they are additive. This statement couldnt be truer todaythe rise of technologies like Kata Containers that combine the use of lightweight virtual machines to run containers, thus allowing us to have the best of both worlds (the isolation of VMs with the portability of containers), are an attestation to Lauras commentary.