thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

Docker Layer

A read-only filesystem diff produced by a Dockerfile instruction; images are stacks of layers combined by a union filesystem.

Definition

Layers are content-addressed and shared across images, saving disk and bandwidth. The build cache reuses unchanged layers; once a layer changes, all subsequent layers rebuild. Files deleted in a later layer still exist in earlier layers.

Example

Combining apt-get update and install in one RUN avoids stale cached package lists.

Exam tip

Deleting a secret in a later layer does not remove it from the image; never COPY secrets into images.

Related terms