Chapter 8. Building images automatically with Dockerfiles

This chapter covers

  • Automated image packaging with Dockerfiles
  • Metadata and filesystem instructions
  • Creating maintainable image builds with arguments and multiple stages
  • Packaging for multiprocess and durable containers
  • Reducing the image attack surface and building trust

A Dockerfile is a text file that contains instructions for building an image. The Docker image builder executes the Dockerfile from top to bottom, and the instructions can configure or change anything about an image. Building images from Dockerfiles makes tasks like adding files to a container from your computer simple one-line instructions. Dockerfiles are the most common way to describe how to build a Docker image. ...

Get Docker in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.