Dockerfiles and Docker build—A Deep Dive

A Docker image is the artifact of the container world. Leaner images allow easier for quicker build times, less resource management (disk pressure and network usage), fewer attack vectors, and better performance when pulling or pushing images for storage or upon deployment. Lean images also produce smaller containers, which in turn require fewer resources at runtime, allowing for higher server density. Multistage Dockerfiles can help reduce the complexity of CI/CD pipelines by reducing the number of moving parts in building, testing, and producing a production-grade image. The key to building leaner (smaller) images, with little build-time overhead is to understand how Docker uses the Union File System (UFS), how Docker builds (and when it busts) the cache, and how to use the Dockerfile specification to it's fullest potential.

In this exercises driven, hands-on workshop, we will dive deep, peeking under the hood to get a glimpse of the Union File System, and then proceed to look at the effects of many of the important Dockerfile instructions. We will see how best to use them, and highlight any caveats that we should be aware of.

By the end of this class you will have gained a keen understanding of how best to write your Dockerfiles, and effectively build and design lean images, and containers.


About Raju Gandhi

Raju is a software craftsman with almost 20 years of hands-on experience scoping, architecting, designing, implementing full stack applications.

He provides a 360 view of the development cycle, is proficient in a variety of programming languages and paradigms, experienced with software development methodologies, as well an expert in infrastructure and tooling.

He has long been in the pursuit of hermeticism across the development stack by championing immutability during development (with languages like Clojure), deployment (leveraging tools like Docker and Kubernetes), and provisioning and configuration via code (toolkits like Ansible, Terraform, Packer, everything-as-code).

Raju is a published author, internationally known public speaker and trainer.
Raju can be found on Twitter as @looselytyped.
In his spare time, you will find Raju reading, playing with technology, or spending time with his wonderful (and significantly better) other half.

More About Raju »