docker无法删除overlay network

现象

最近遇到一个问题,在docker swarm中创建的一个overlay网络无法删除,出现如下错误:
在这里插入图片描述

解决办法

在几个节点上找了个遍,并没有发现哪个容器在使用这个网络,最后在github上找到解决办法如下:
docker inspect --type task 2oj41jpa55l27c639bg28zgtn
其中2oj41jpa55l27c639bg28zgtn就是提示你仍在使用网络task的id。
在这里插入图片描述
如图所示,有两个关键的信息,ID是还存或的容器的id,NodeID是这个容器所在的节点,通过这个两个参数,就可以找到对应的容器,然后删除掉。网络也可以删除了。

在这里插入图片描述
进入到该节点,删除容器即可。

The Docker overlay network driver is designed to provide a scalable and flexible networking solution for Docker containers running on multiple hosts. The overlay network driver allows Docker containers to communicate with each other seamlessly, regardless of the host they are running on. When using the overlay network driver, Docker logs are also handled differently than with other drivers. Docker logs from containers running on an overlay network are not automatically sent to the host's syslog daemon, as they are with the default bridge network driver. Instead, Docker logs are sent directly to the Docker daemon on the host where the container is running. To view Docker logs for containers running on an overlay network, you can use the `docker logs` command followed by the container ID or name. For example, to view the logs for a container named `my-container` running on an overlay network named `my-overlay-network`, you would use the following command: ``` docker logs my-container ``` If you want to view the logs for a container running on a specific host in an overlay network, you can use the `docker logs` command with the `--tail` and `--follow` options, followed by the container ID or name and the hostname. For example, to view the logs for a container named `my-container` running on a host named `my-host` in an overlay network named `my-overlay-network`, you would use the following command: ``` docker logs --tail 100 --follow my-container@my-host ``` This command will display the last 100 lines of logs for the container and continue to follow new logs as they are generated.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值