Skip to content

How docker build turns a Dockerfile into layers

Select an icon to see what it is.

Step 1 of 6

The CLI starts a build session

For this Dockerfile the CLI opens a session with dockerd, then sends POST /build with version=2, which selects BuildKit. BuildKit asks the CLI for the files it needs from the build context. It does not upload the whole directory first.

$ docker build -t web:1.0 .
PrevNext

POST /v1.45/session

connection upgraded to gRPC
serves file sync from the build context