关于harbor的报错问题

docker-compose  down停止harbor时出现问题。
ERROR: error while removing network: network harbor_harbor id c3fd4485fc70ac39f304e1dc88e68c0292a6ed4d872bc246b47b8a1fee0c40f0 has active endpoints

 由于我的harbor容器镜像仓库出现问题, goharbor/nginx-photon:v2.1.5镜像无法启动,这是因为网卡无法移除造成的,需要手动去操作。

因为报错已经说明网卡为harbor_harbor ,所以执行下面的命令查看信息

 docker network  inspect harbor_harbor

打印出下面内容:
[
    {
        "Name": "harbor_harbor",  #参数1
        "Id": "c3fd4485fc70ac39f304e1dc88e68c0292a6ed4d872bc246b47b8a1fee0c40f0",
        "Created": "2021-04-30T00:10:16.400151438+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": {
            "aa2c8463bd66f8c531e47bd81029dc4c5dde984909e0f55b56414bd4975acebe": {
                "Name": "nginx",    #参数2
                "EndpointID": "f47bbf14ced631b98270031e9b1a52e0f89789f4479b3f37c7855dd912d5119a",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "harbor",
            "com.docker.compose.project": "harbor",
            "com.docker.compose.version": "1.21.2"
        }
    }
]

记住参数1和参数2:

然后执行下面命令手动移除网卡

例:#docker network disconnect -f 参数1 参数2


docker network disconnect -f harbor_harbor nginx

最后成功移除了就可以执行停止命令了

docker-compose down
docker -compose up
posted @ 2021-05-04 23:15  天府熊大  阅读(1004)  评论(1编辑  收藏  举报