LOGBOOK

HELP

Quiz Entry - updated: 2026.11.30

What is a dangling volume, and why should you care about them?

A volume that still exists but is no longer attached to any container. It keeps its data, taking up disk space and potentially holding sensitive leftovers.

Volumes deliberately outlive containers, which is the whole point of them. The flip side: when a container is removed (even with docker run --rm), its named volumes stay behind. In the lab:

docker container run --rm --mount type=volume,src=danglingvolume,dst=/tmp alpine
docker volume ls --filter "dangling=true"   # danglingvolume is listed

Over time, dangling volumes:

  • fill the disk on a busy host;
  • retain data (database contents, keys, logs) long after the service is gone, where any container that mounts the volume by name can read it. That is a confidentiality risk.

Clean them up deliberately with docker volume prune (or docker system prune --volumes) once you are sure the data is not needed.

Go deeper:

From Quiz: ISLAB / Docker Introduction | Updated: Nov 30, 2026