docker build

The command that builds an image from a Dockerfile and a build context.

In more detail

It reads the Dockerfile, runs each instruction and stores the result as image layers. The --tag option names the image so it can be pushed and referenced later.

Examples

docker build --tag "ghcr.io/acme/checkout:$GITHUB_SHA" .
docker build -t taskapi:0.1 .
docker build -t healthcheck:dev .
docker build -q -t m04l01-client .

Related terms

Taught in

References

Certification courses