Docker: Images
4 Docker commands: Images. Click a command to see what each part does.
Docker: ImagesIndex
- Whole sheet120
- Basics: images & containers11
- Volumes & networks4
- Find & inspect containers7
- Environment variables & container config12
- Software versions inside containers & images9
- Logs & shells5
- Run containers3
- Images4
- Cleanup6
- Docker Compose v27
- Container lifecycle & live changes10
- Builds, multi-platform & moving images11
- Volumes, networks & remote hosts in depth12
- Compose: more commands9
- Swarm mode10
Images4
docker build -t <registry>/<image>:<tag> -f <Dockerfile> .Build and tag an imageWhat each part does
docker buildbuild an image (BuildKit)-t <registry>/<image>:<tag>name and tag for the result-f <Dockerfile>which Dockerfile (default ./Dockerfile).build context: the folder sent to the builder (.dockerignore trims it)
docker build --no-cache --pull --target <stage> --build-arg <KEY>=<value> -t <image>:<tag> .Clean rebuild of one stage with a build argWhat each part does
--no-cacheignore cached layers--pullalways check for a newer base image--target <stage>stop at a named stage of a multi-stage Dockerfile--build-arg <KEY>=<value>value for an ARG in the Dockerfile
docker tag <image>:<tag> <registry>/<image>:<tag> && docker push <registry>/<image>:<tag>Tag and push to a registryWhat each part does
docker tag <src> <target>add another name to an existing image&&only if tagging workeddocker push <target>upload it (run docker login <registry> first)
docker history --no-trunc <image>Image layers and what created themWhat each part does
docker historyone row per layer with its size--no-truncshow the full command that created each layer
Nothing matches.
My DevOps Playbook by Angelo John Calleja