anonymous volume: A volume with a random name created automatically — by a VOLUME directive or a -v with no source name. Easy to leave dangling. An anonymous volume is a Docker volume with a random name instead of one you chose. It is created when a Dockerfile has a VOLUME instruction, or when you run docker run -v /data without naming a source.
The data survives container restarts, but it is hard to find again. A new container usually gets a new anonymous volume, so it looks as if your data disappeared. Old anonymous volumes also pile up and fill the disk.
What should you keep in mind with anonymous volume?
Use named volumes for anything you care about, such as -v pgdata:/var/lib/postgresql/data. They are easy to list, back up and reuse. Run docker volume ls now and then to see what has accumulated, and docker volume prune to remove volumes no container uses. Check the list before pruning, because deleted volumes cannot be recovered.
What does an example of anonymous volume look like?
Use this skill when creating, modifying, or debugging Docker Compose configurations, even if the user just says they need to wire services together, add a database to their stack, or set up a local development environment with multiple containers. Covers service definitions, health checks, dependency ordering, volumes, networks, environment variables, and development overrides.
Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`,
Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.