ٍSofyan Mahmoud
ٍSofyan Mahmoud

Reputation: 326

Is docker volume deleted if the container is deleted?

I'm reading the book The docker book version v1.2.0, in chapter 6 in page 178 it said that

if you deleted the last container that uses a volume, the volume will disappear. Be carful about deleting containers that might hold volumes with data you need

But when I tried it, the volume isn't deleted. Is that just because I'm reading old version ??

Upvotes: 1

Views: 2207

Answers (1)

MaatMa
MaatMa

Reputation: 214

The newer versions will not delete your volume, unless you're using the parameter --volumes or -v.

https://docs.docker.com/engine/reference/commandline/rm/#options

Upvotes: 2

Related Questions