DELAPARRA
Index
Color
NL
Category: Docker

anonymous volume

Explained by Updated

What is anonymous volume?

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.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about anonymous volume

How is anonymous volume used in practice?

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?

docker run -v /var/lib/data myapp:1.0

At a glance

CategoryDocker
Explained by
Updated

More Docker terms

All terms starting with A

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.