Skip to content

How docker build turns a Dockerfile into layers

Select an icon to see what it is.

Step 3 of 6

COPY adds a layer

COPY app.sh /app.sh copies one file from the build context into a new layer. The layer holds only that file. BuildKit keys the cache on the instruction and on the file's content.

BuildKit log (illustrative numbers) and the new layer, path may differ

#4 [2/3] COPY app.sh /app.sh
/var/lib/docker/overlay2/<new-layer>/diff/app.sh