Docker Bip 自定义网段备忘

错误

1
2
3
# journalctl -u docker.service --since "10 minutes ago"

failed to start daemon: Error initializing network controller: error creating default "bridge" network: failed to allocate gateway (172.20.0.0): Address already in use.

BIP 设置

1
2
3
4
5
6
{
"insecure-registries": [
"0.0.0.0/0"
],
"bip": "172.20.0.1/16"
}

限制

网段不能以.0​结尾,只能以.1​结尾,因为需要一个实际地址分配给 docker0​网卡

参考文档