删除 Docker Swarm 服务是否会删除关联的卷数据?
Does removing a Docker Swarm service remove associated volume data?
如果我运行docker service rm <service>
,<service>'s
卷数据会被删除吗? Documentation on this command 没有指定一种方式。
试过了。答案是否定的,卷数据不会被删除
> 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
如果我运行docker service rm <service>
,<service>'s
卷数据会被删除吗? Documentation on this command 没有指定一种方式。
试过了。答案是否定的,卷数据不会被删除
> 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