简体   繁体   English

docker swarm init 的反义词是什么?

[英]What is opposite of docker swarm init?

With a single host with a swarm that has been created with init, the host gets networks created etc.使用带有 init 创建的集群的单个主机,主机会创建网络等。

There appears to be no 'docker swarm destroy' or similar that purges the system back to a state before the swarm.似乎没有“docker swarm destroy”或类似的东西可以将系统清除回群之前的状态。 I did a leave --force but that left networks.我请假了 --force 但这离开了网络。

Do you have to manually tidy up a bunch of things you don't know were created or is there an easy command to get back to a clean setup?您是否必须手动整理一堆您不知道已创建的东西,或者是否有一个简单的命令可以恢复干净的设置?

Thanks谢谢

docker swarm leave is the only command for reverting swarm membership. docker swarm leave是恢复 swarm 成员身份的唯一命令。 It cleans up all swarm specific artefacts that were created by docker stack deploy , eg overlay networks and secrets.它会清除由docker stack deploy创建的所有特定于 swarm 的人工制品,例如覆盖网络和机密。

If you still got user defined networks after leaving the swarm, these were probably created by docker-compose .如果你在离开 swarm 后仍然有用户定义的网络,这些可能是由docker-compose创建的。 Note that this is not swarm specific, it can also happen in standalone mode.请注意,这不是特定于 swarm 的,它也可以在独立模式下发生。

You can get a listing of all networks that were created by docker-compose with您可以获得由docker-compose创建的所有网络的列表

docker network ls --filter label=com.docker.compose.project

and get rid of them with并摆脱他们

docker network rm $(docker network ls --filter label=com.docker.compose.project -q)

如果 docker 实例是管理器: docker swarm leave --force

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM