背景:想修改docker0的ip地址,所以在/etc/docker/daemon.json文件里加了【bip】.
{
"registry-mirrors": ["https://f61bammj.mirror.aliyuncs.com","https://registry.docker-cn.com"],
"bip": "10.1.0.0/24"
}
然后再启动docker就出下面的错误了。
# systemctl status docker.service
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Tue 2017-11-14 20:52:23 UTC; 6min ago
Docs: https://docs.docker.com
Process: 1661 ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)
Main PID: 1661 (code=exited, status=1/FAILURE)
分析:IP("10.1.0.0/24")不合法。
解决办法:
- 删除/var/lib/docker。(rm -rf /var/lib/docker)
- 删除/var/run/docker。(rm -rf /var/run/docker)
- 改成"10.1.0.0/16"
- 重启系统