soundstripe
soundstripe

Reputation: 1474

Does removing a Docker Swarm service remove associated volume data?

If I run docker service rm <service>, will the <service>'s volume data be deleted? Documentation on this command does not specify one way or the other.

Upvotes: 1

Views: 992

Answers (1)

soundstripe
soundstripe

Reputation: 1474

Tried it out. The answer is no, the volume data will not be deleted.

> docker service create --name test_container --replicas 1 --mount type=volume,source=test_vol,destination=/mnt busybox top
...
verify: Service converged
> docker service rm test_container
test_container
> docker volume ls
DRIVER              VOLUME NAME
local               test_vol

Upvotes: 3

Related Questions