Debian8 docker启动失败


time="2016-11-12T17:25:20.780711658+08:00" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: cannot create network b771b6774812fc0763067ac98d4bbdb7691e79adfa4259ec069cd1193d6bbbc0 (docker0): conflicts with network ac05f2311641c8630e8cdd05ff7e8f55b076b19316b55a28f54dea0e45704d6e (docker0): networks have same bridge name"
time="2016-11-12T17:32:34+08:00" level=info msg="stopping containerd after receiving terminated"

想删除docker重新安装也不行:
Preparing to unpack .../docker-engine_1.12.3-0~jessie_amd64.deb ...
Stopping Docker: dockerstart-stop-daemon: warning: failed to kill 7085: No such process
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Stopping Docker: dockerstart-stop-daemon: warning: failed to kill 7085: No such process
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/docker-engine_1.12.3-0~jessie_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
已邀请:

tuhao

赞同来自:


后面我用了一种临时解决办法:创建自定义网桥,然后在docker配置中指定默认网关为172.18.0.1/16后,顺利启动了docker daemon。上面报错意思是新创建的docker网桥跟之前的重复了,当然重启服务前早ifdown且brctl delbr相关网桥了,既然这样,只能用新网桥了。
后面升级docker-engine到1.12.3观察,没看到报错了。
处理过程:

<span style="font-size:16px">#Debian8</span>

<ol><li>安装brctl</li></ol>apt-get install bridge-utils
<ol><li>确保服务停止,删除旧网桥</li></ol>$ sudo service docker stop
$ sudo ip link set dev docker0 down
$ sudo brctl delbr docker0
<ol><li>创建网桥</li></ol>$ sudo brctl addbr bridge0
$ sudo ip addr add 172.18.0.1/16 dev bridge0
$ sudo ip link set dev bridge0 up
$ ip addr show bridge0
<ol><li>配置docker并启动</li></ol>$ echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker
$ sudo service docker start

启动后查看日志仍有报错,不过不影响服务启动和创建容器
```
time="2016-11-12T18:41:54.705574176+08:00" level=info msg="previous instance of containerd still alive (13878)"
time="2016-11-12T18:41:54.711354076+08:00" level=info msg=" using prior storage driver \"aufs\""
time="2016-11-12T18:41:54.737608905+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2016-11-12T18:41:54.745592848+08:00" level=info msg="Firewalld running: false"
time="2016-11-12T18:41:55.016100615+08:00" level=warning msg="Your kernel does not support cgroup memory limit"
time="2016-11-12T18:41:55.016210312+08:00" level=warning msg="Your kernel does not support cgroup cfs period"
time="2016-11-12T18:41:55.016250959+08:00" level=warning msg="Your kernel does not support cgroup cfs quotas"
time="2016-11-12T18:41:55.016591138+08:00" level=warning msg="mountpoint for pids not found"
time="2016-11-12T18:41:55.022707747+08:00" level=info msg="Loading containers: start."
.......................................time="2016-11-12T18:41:55.264854601+08:00" level=warning msg="error locating sandbox id a36ab366a9fc7a43df0f019edfdfa5f514d631a96586dc97bc5b183ec2eaef05: sandbox a36ab366a9fc7a43df0f019edfdfa5f514d631a96586dc97bc5b183ec2eaef05 not found"
time="2016-11-12T18:41:55.265014263+08:00" level=warning msg="failed to cleanup ipc mounts:\nfailed to umount /var/lib/docker/containers/a7af2ddce8b9c52fd17e0131a328b60ef4efeec1665bea481968f2e6f924f57e/shm: invalid argument"

time="2016-11-12T18:41:55.274634656+08:00" level=info msg="Loading containers: done."
time="2016-11-12T18:41:55.274672460+08:00" level=info msg="Daemon has completed initialization"
time="2016-11-12T18:41:55.274694812+08:00" level=info msg="Docker daemon" commit=b9f10c9 graphdriver=aufs version=1.11.2
time="2016-11-12T18:41:55.287260280+08:00" level=info msg="API listen on /var/run/docker.sock"
```

要回复问题请先登录注册