Skip to content
Images and registryDocker

docker build

Create an image from a Dockerfile and context directory.

Command
docker build -t /: .

Example usage

Build images with tags, custom Dockerfiles, and target platforms.

docker build -t <repo>/<image_name>:<tag> .
docker build --platform linux/amd64 -f <dockerfile_path> -t <image_name> <context_dir>

Related tags

Images and registrycontainersimagescompose