我正在尝试运行 docker-compose up -d
关注 docker-compose.yml
文件
version: '2'
services:
php7-cli:
build: php7-cli
image: php7-cli
tty: true
volumes:
- ../:/var/www/app
networks:
- my-network
networks:
my-network:
driver: bridge
docker-compose build
构建成功,但如果我尝试 docker-compose up
,我收到以下错误消息:ERROR: could not find an available, non-overlapping IPv4 address
pool among the defaults to assign to the network
当我尝试
docker network ls
, 我有NETWORK ID NAME DRIVER SCOPE
7c8a6c131c1b bridge bridge local
9f16d3a33b4e host host local
24c54a4323ed none null local
我试图通过
docker network prune
删除孤立网络但这些网络都没有被删除。然后我尝试删除
bridge
手动网络docker network rm 7c8a6c131c1b
但我收到了这个错误
Error response from daemon: bridge is a pre-defined network and cannot be removed
这是我的
docker version
docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:17:20 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:15:30 2018
OS/Arch: linux/amd64
Experimental: false
最佳答案
将网络接口(interface)从 ens33 重命名为 eth0 后,同样的问题就消失了。
使用的一种指南是 https://www.itzgeek.com/how-tos/mini-howtos/change-default-network-name-ens33-to-old-eth0-on-ubuntu-16-04.html
关于PHP CLI - 错误 : could not find an available, 在分配给网络的默认值中不重叠的 IPv4 地址池,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50911108/