Prune everything unused

Remove stopped containers, unused images, networks, volumes

docker system prune -af --volumes

tool
docker46 commands
tags
docker

More docker commands

  • docker pull src-reg/img:tag && docker tag src-reg/img:tag dst-reg/img:tag && docker push dst-reg/img:tag

    Re-tag and push to another registry

  • docker save img:tag | gzip > img.tar.gz

    Export an image for air-gapped transfer

  • docker build --build-arg VERSION=1.2.3 --build-arg ENV=prod -t img:tag .

    Pass build-time variables into Dockerfile ARG instructions

  • trivy image --exit-code 1 --severity HIGH,CRITICAL img:tag

    Fail pipeline if HIGH or CRITICAL CVEs found

  • docker sbom img:tag

    Generate Software Bill of Materials for an image (Docker Desktop)

all 46 docker commands