**
**
使用docker-compose up 启动jumpserver项目时,出现报错
ERROR: network jumpserver_default has active endpoints
同样在关闭时也报错:
[root@localhost jumpserver]# docker-compose up
Creating redis ...
Creating redis ... done
Creating jumpserver ...
Creating jumpserver ... error
ERROR: for jumpserver Cannot start service jumpserver: service endpoint with name jumpserver already exists
ERROR: for jumpserver Cannot start service jumpserver: service endpoint with name jumpserver already exists
ERROR: Encountered errors while bringing up the project.
**
**
使用 docker network disconnect -f {network} {endpoint-name},其中的 {endpoint-name} 可以使用命令 docker network inspect {network} 获得。
实际如下:
[root@localhost sysconfig]# docker network inspect jumpserver_default
[
{
"Name": "jumpserver_default",
"Id": "945a4fc8137243ea6c6cd8198f92e7d1fe9027f2a70f4a2fba5ec61086f3bbed",
"Created": "2017-12-01T15:29:11.994844259+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,
"Containers": {
"dbcc7e19186acf586353c931c4c7d5455f553e86ff4d0c35482986d48fa1327d": {
"Name": "jumpserver",
"EndpointID": "2df020f59e61d2854e92c3bf78a98d580b6577bfa604e5c4066f622dd0a345fa",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
可以看到jump_default 的endpoint的名称“Name”为jumpserver
所以执行以下命令清除即可:
[root@localhost sysconfig]# docker network disconnect -f jumpserver_default jumpserver
[root@localhost sysconfig]# docker network inspect jumpserver_default
[
{
"Name": "jumpserver_default",
"Id": "945a4fc8137243ea6c6cd8198f92e7d1fe9027f2a70f4a2fba5ec61086f3bbed",
"Created": "2017-12-01T15:29:11.994844259+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,
"Containers": {},
"Options": {},
"Labels": {}
}
]
重新使用docker-compose up -d 启动jumpserver服务。