Chapter 2: Building Container Images

In this chapter, you will start building container images. We will look at five different ways you can define and build images using native Docker tools.

We will discuss the recommended ways that you can define and build your own images, as well as one way that is not considered to be a best practice but does have its uses.

We will cover the following topics:

  • Introducing Dockerfiles
  • Building Docker images

Let’s get started!

Technical requirements

In this chapter, we will be using our Docker installation to build images. Some of the supporting commands, which will be few and far between, may only be applicable to macOS and Linux-based operating systems.

Check out the following video to see the Code in ...

Get Mastering Docker - Fourth 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.