代码之家  ›  专栏  ›  技术社区  ›  soundstripe

删除Docker Swarm服务是否会删除相关的卷数据?

  •  0
  • soundstripe  · 技术社区  · 6 年前

    如果我跑 docker service rm <service> <service>'s 是否删除卷数据? Documentation on this command 不指定一种或另一种方式。

    1 回复  |  直到 6 年前
        1
  •  1
  •   soundstripe    6 年前

    试一试。答案是“否”,卷数据将不会被删除。

    > 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