Inspecting the Dockerfile

Examine the layers of a single-container application's Dockerfile.

What is a Dockerfile?

A Dockerfile is the starting point for creating a container image. It describes an application and tells Docker how to build it into an image.

The directory containing the application and dependencies is referred to as the build context. It’s a common practice to keep your Dockerfile in the root directory of the build context. It’s also important that Dockerfile starts with a capital “D” and is one word. “dockerfile” and “Docker file” are not valid.

Look at the contents of the Dockerfile.

You can view the Dockerfile using the $ cat Dockerfile as well.

Get hands-on with 1000+ tech skills courses.