Error response from daemon: service endpoint with name already exists

No Comments Docker

删除原容器后,创建新容器报错
Error response from daemon: service endpoint with name gitlab03 already exists

原因,是容器被删了。但网络占用仍在占用
解决
1.确认删除容器  docker rm -f 容器ID
2.确认容器使用的网络也被删除
docker network inspect 网络模式
3.强制断开该网络 docker network disconnect –force 网络模式 xxx
docker network disconnect –force bridge gitlab03
4.验证 不出现gitlab03即可
[root@hk-ops-ser-gitlab-001 ~]# docker network inspect bridge
5.重建容器即可

这是之前的信息
[root@hk-ops-ser-gitlab-001 ~]# docker network inspect bridge
        "Name": "bridge",
                "Name": "gitlab03",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",

发表评论