Forrest logo
back to the docker tool

docker:tldr:82bee

docker: Remove unused data.
$ docker system prune
try on your machine

The command docker system prune is used to clean up unused Docker resources like containers, images, networks, and volumes that are not currently being used by any running container.

When you run this command, Docker will perform the following clean-up actions:

  1. Remove all stopped containers: It removes all containers that are not currently running.
  2. Remove all unused networks: Docker deletes any network created by the user and not currently in use by any containers.
  3. Remove all dangling images: Dangling images are the intermediate images left behind when you build a new version of an image. Docker deletes these unused images.
  4. Remove all build cache: If you have any build cache stored on the system, Docker will remove it.
  5. Remove all unused volumes: Docker removes any volumes that are not currently being used by any containers.

Note that before performing any deletions, Docker will prompt you to confirm the removal of these unused resources, giving you the opportunity to review and prevent any accidental removal.

This command is handy to reclaim disk space on your Docker system by removing any unused containers, images, networks, and volumes.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool