Error response from daemon: error while removing network

docker 网络出问题了,然后使用命令进行删除,结果报错,如下:

[root@harbor harbor]# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
93f0ec306ab5        bridge              bridge              local
821031255cda        harbor_harbor       bridge              local
[root@harbor harbor]# docker network rm 821031255cda
Error response from daemon: error while removing network: network harbor_harbor id 821031255cdaf4909913c8a1c9451db461e898a877661564f59cd13f4d0d68b5 has active endpoints

解决方法如下:

[root@harbor harbor]# docker network inspect harbor_harbor
[
    {
        "Name": "harbor_harbor",   #参数一
        "Id": "821031255cdaf4909913c8a1c9451db461e898a877661564f59cd13f4d0d68b5",
        "Created": "2019-11-08T17:16:11.031524353+08:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "98cbc25660b315f0a639d3340aad084b2819d43fc966969316597d42f5b1b84c": {
                "Name": "harbor-core",   # 参数二
                "EndpointID": "254f0dae9697b07294670b596f74e9d95056739d85f75c6722e70c539e50aa86",
                "MacAddress": "02:42:ac:12:00:08",
                "IPv4Address": "172.18.0.8/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "harbor",
            "com.docker.compose.project": "harbor",
            "com.docker.compose.version": "1.24.1"
        }
    }
]

记下上面输出的“参数一”和“参数二”,然后执行如下命令:

[root@harbor harbor]# docker network disconnect -f harbor_harbor harbor-core

然后问题就解决了。


(END)

发布了378 篇原创文章 · 获赞 1419 · 访问量 632万+

猜你喜欢

转载自blog.csdn.net/catoop/article/details/103463007