Skip to main content
Kill -9 Club
Sign in

anonymous volume

Containers

A volume Docker creates for itself when nothing names one: a VOLUME /data line in an image's Dockerfile, or a -v /app/uploads with no source. Its name is a 64-character hex id, and docker volume ls lists it among the ones you chose. That is where the reading goes wrong. docker system prune --volumes is documented as sparing named volumes, and it does — so the clean-up reads as safe, while it takes exactly the volumes an image created without asking you. The data in them has no second copy and nothing to undo. docker volume ls -f dangling=true shows what no container is using, and the 64-character names are the ones that command will take. Naming the volume yourself — -v pgdata:/var/lib/postgresql/data — is the one thing that puts it out of reach.

Also written: unnamed volume, dangling volume

anonymous volume — definition | Kill -9 Club