Inspect image layers docker
See each layer, its command, and size; identify bloat
docker history --no-trunc img:tag
more docker
all 46 commands →
Prune everything unused
docker system prune -af --volumes
Copy image between registries
docker pull src-reg/img:tag && docker tag src-reg/img:tag dst-reg/img:tag && docker push dst-reg/img:tag
Save image to tarball
docker save img:tag | gzip > img.tar.gz
Build with build args
docker build --build-arg VERSION=1.2.3 --build-arg ENV=prod -t img:tag .
Scan image with Trivy
trivy image --exit-code 1 --severity HIGH,CRITICAL img:tag