After installing docker-engine on Centos-7, it failed to start by
systemctl start docker.service
After I use
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: exit-code) since Fri 2016-04-01 19:07:00 CST; 3s ago Docs: https://docs.docker.com Process: 8136 ExecStart=/usr/bin/docker daemon --storage-driver=devicemapper --storage-opt dm.datadev=/dev/direct-lvm/data --storage-opt dm.metadatadev=/dev/direct-lvm/metadata -H fd:// --insecure-registry reg.docker.alibaba-inc.com (code=exited, status=1/FAILURE) Main PID: 8136 (code=exited, status=1/FAILURE)
To see more details, I use
sudo journalctl -xe
There were much more informations now:
... Apr 01 19:07:00 XXX docker: time="2016-04-01T19:07:00.187369563+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" Apr 01 19:07:00 XXX docker: time="2016-04-01T19:07:00.511949325+08:00" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: Failed to setup IP tables, cannot acquire Interface address: Interface docker0 has no IPv4 addresses" ...
The ethernet interface of docker0 can not be assigned IPv4 addresse. It seems many people meet this problem after I searching the google, but none of the solutions works for me. Consequently, I find out this solution in my environment (totally remove the network bridge):
sudo ifconfig docker0 down sudo brctl delbr docker0
and my docker service startup now!
The key is: docker-engine will not assign IP to docker0 interface which is already exists.