docker-compose up ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
解决方法:
创建一个永久的码头网络:
docker network create my-network --subnet 172.24.24.0/24
然后
vim docker-compose.yml
修改将网络指定为外部
version: "2"
services:
postgres:
container_name: postgres
image: postgres
volumes:
- ./volumes/postgres/data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=dummy
- POSTGRES_USER=user
- POSTGRES_PASSWORD=123456
- POSTGRES_HOST=localhost
networks:
- default
ports:
- "127.0.0.1:5432:5432"
networks:
default:
external:
name: my-network