docs icon indicating copy to clipboard operation
docs copied to clipboard

Possible mistake in behaviour of anonymous volumes on destruction of associated containers

Open mklilley opened this issue 2 years ago • 0 comments

File: compose/compose-file/compose-file-v3.md.

On Volumes for services, swarms, and stack files, the docs say:

In the absence of having named volumes with specified sources, Docker creates an anonymous volume for each task backing a service. Anonymous volumes do not persist after the associated containers are removed.

From what I can tell from my own experimentation, the statement Anonymous volumes do not persist after the associated containers are removed doesn't appear to be true. If I docker compose up without a named volume then indeed an anonymous volume is created. When I docker compose down, the containers are destroyed but the anonymous volume persists.

I've been using version: "3" on my compose files and I'm aware from the docs that this is a legacy version. I just wanted to flag this in case it was a mistake.

mklilley avatar Aug 08 '22 11:08 mklilley