最佳答案
我有一个 docker-与一些 php,mysql 等组成开始。几天后,我不能把他们下来,因为一切停止,而不是 mysql。它总是给我以下错误:
ERROR: network docker_default has active endpoints
这是我的码头作品
version: '2'
services:
php:
build: php-docker/.
container_name: php
ports:
- "9000:9000"
volumes:
- /var/www/:/var/www/
links:
- mysql:mysql
restart: always
nginx:
build: nginx-docker/.
container_name: nginx
links:
- php
- mysql:mysql
environment:
WORDPRESS_DB_HOST: mysql:3306
ports:
- "80:80"
volumes:
- /var/log/nginx:/var/log/nginx
- /var/www/:/var/www/
- /var/logs/nginx:/var/logs/nginx
- /var/config/nginx/certs:/etc/nginx/certs
- /var/config/nginx/sites-enabled:/etc/nginx/sites-available
restart: always
mysql:
build: mysql-docker/.
container_name: mysql
volumes:
- /var/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: pw
MYSQL_USER: florian
MYSQL_PASSWORD: pw
MYSQL_DATABASE: database
restart: always
phpmyadmin:
build: phpmyadmin/.
links:
- mysql:db
ports:
- 1234:80
container_name: phpmyadmin
environment:
PMA_ARBITRARY: 1
PMA_USERNAME: florian
PMA_PASSWORD: pw
MYSQL_ROOT_PASSWORD: pw
restart: always
docker network inspect docker_default
告诉我:
[
{
"Name": "docker_default",
"Id": "1ed93da1a82efdab065e3a833067615e2d8b76336968a2591584af5874f07622",
"Created": "2017-03-08T07:21:34.969179141Z",
"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": {
"85985605f1c0c20e5ee9fedc95800327f782beafc0049f51e645146d2e954b7d": {
"Name": "mysql",
"EndpointID": "84fb19cd428f8b0ba764b396362727d9809cd1cfea536e648bfc4752c5cb6b27",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
看起来 docker rm mysql -f
停止了 mysql 容器,但是网络正在运行。
删除了与 docker network disconnect -f docker_default mysql
的网络,但我很感兴趣,我是如何进入这种情况。有什么想法?