harbor容器删除失败解决办法

发布于:2024-04-14 ⋅ 阅读:(201) ⋅ 点赞:(0)

docker中harbor容器删除失败 出现的问题以及解决方法

[root@k8s-master-node1 harbor]# docker-compose down 
[+] Running 8/8
 ⠿ Container nginx              Removed                                                                                                0.1s
 ⠿ Container harbor-jobservice  Removed                                                                                               10.3s
 ⠿ Container registryctl        Removed                                                                                               10.2s
 ⠿ Container harbor-portal      Removed                                                                                                0.1s
 ⠿ Container harbor-core        Removed                                                                                               10.1s
 ⠿ Container redis              Removed                                                                                                0.2s
 ⠿ Container harbor-db          Removed                                                                                               10.2s
 ⠿ Container registry           Removed                                                                                               10.2s
 ⠿ Network harbor_harbor        Error                                                                                                  0.0s
failed to remove network 3971d3fc3caa717b20dde5e212f09f34f404f522ab65a0559c4a1f9fc538256b: Error response from daemon: error while removing network: network harbor_harbor id 3971d3fc3caa717b20dde5e212f09f34f404f522ab65a0559c4a1f9fc538256b has active endpoints
[root@k8s-master-node1 harbor]# docker network inspect harbor_harbor

我们可以看到harbor_harbor网络删除失败是因为此网络中依然有几个活跃容器存在那么我们需要先删除活跃容器再删除此网络

[root@k8s-master-node1 harbor]# docker network inspect harbor_harbor
[
    {
        "Name": "harbor_harbor",
        "Id": "3971d3fc3caa717b20dde5e212f09f34f404f522ab65a0559c4a1f9fc538256b",
        "Created": "2024-03-23T21:55:49.115824975+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": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "23bbeab6eafe1a89b429539427b0fd929d6a5031f6fea8e97afb5a7b992a88f2": {
                "Name": "harbor-portal",
                "EndpointID": "5f9fb40fba5d8a19187350c6cb69726bb768c0e8df918c8adf64780e78574338",
                "MacAddress": "02:42:ac:12:00:06",
                "IPv4Address": "172.18.0.6/16",
                "IPv6Address": ""
            },
            "ab6fc6b77b8207355461ad0905c9b416c78a6725711e5a31318f8ea95cf7061d": {
                "Name": "harbor-log",
                "EndpointID": "885329a85d08650c5548f83ed90420bbe9c2cc549553ea63ef5362b50c9b9f6b",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            },
            "b5d43d4fbbe164c3700d9e73d0e6ece25dd53eeaa776f66fabb374f9d365ebe1": {
                "Name": "harbor-jobservice",
                "EndpointID": "b60dcd688c47ab64a2238fac1e0a9d3c29a6e9e1f73c80b5fb5b87f285022830",
                "MacAddress": "02:42:ac:12:00:09",
                "IPv4Address": "172.18.0.9/16",
                "IPv6Address": ""
            },
            "e5e01b2675b33825f94fa162939b9100f903ad2f7be7914710d63e968b537d14": {
                "Name": "nginx",
                "EndpointID": "0b0a49e9c2147f9036d51fa0d49f59565ac631ccfed38dca43aebd096c90554c",
                "MacAddress": "02:42:ac:12:00:0a",
                "IPv4Address": "172.18.0.10/16",
                "IPv6Address": ""
            },
            "fa4afe7213b09c5d2d96b4ed214f3b097a92ab759581db82370df1c3f183775e": {
                "Name": "registryctl",
                "EndpointID": "dbe171abcf1640dcb0ba2a72f4132c14778ffc30c447edc8d08ce5fa38f2453b",
                "MacAddress": "02:42:ac:12:00:07",
                "IPv4Address": "172.18.0.7/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "harbor",
            "com.docker.compose.project": "harbor",
            "com.docker.compose.version": "2.2.1"
        }
    }
]

使用以上命令查看docker网络harbor_harbor中的活跃容器

然后强制删除

[root@k8s-master-node1 harbor]# docker network inspect harbor_harbor
[]
Error: No such network: harbor_harbor


网站公告

今日签到

点亮在社区的每一天
去签到