Docker startup fail - conflicts with network
These days I started with my first steps into Docker.
We are using it at the company I work for and also for some private stuff, I
thought it is a good idea to have a fast solution for testing. After I installed
all necessary components (Docker version 1.11.2) the docker-daemon was not able to start.
Everytime I tried to do something like sudo service docker start
it was up for a
short time and then died. In the syslog file where I thought it could maybe
write some more informations to I just found something like
kernel: [26739.904392] init: docker main process (26778) terminated with status 1
kernel: [26739.904404] init: docker main process ended, respawning
kernel: [26739.996901] type=1400 audit(1470401924.989:191): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="docker-default" pid=26866 comm="apparmor_parser"
kernel: [26740.228830] init: docker main process (26854) terminated with status 1
kernel: [26740.228855] init: docker main process ended, respawning
kernel: [26740.600594] init: docker main process (26938) terminated with status 1
kernel: [26740.600604] init: docker respawning too fast, stopped
which was not really helpful.
After asking google for a long time and communicating with some colleagues I
figured out, that docker itself writes to /var/log/upstart/docker.log
during
startup. And there in the end I found a much more helpful message:
time="2016-08-05T14:58:45.274062615+02:00" level=info msg="previous instance of containerd still alive (32462)"
time="2016-08-05T14:58:45.327378999+02:00" level=info msg="[graphdriver] using prior storage driver \"aufs\""
time="2016-08-05T14:58:45.345525023+02:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2016-08-05T14:58:45.355868170+02:00" level=info msg="Firewalld running: false"
time="2016-08-05T14:58:45.440780697+02: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"
time="2016-08-05T14:58:45.576147375+02:00" level=fatal msg="Error starting daemon: Error initializing network controller: Error creating default \"bridge\" network: cannot create network 2609de78a5c0916d8044867aa1be6bce4f77f7bf648611add5ce02fc9ccc2cc4 (docker0): conflicts with network 8e8769f9a3212c1018dbd4663614c376bcd991e66c264e9531a2b224540569cb (docker0): networks have same bridge name"
So, the interface docker0
already exists. Good to know, but where is it configured?!
I took a short view at my /etc/network/interfaces
where I thought it should be
configured. But:
cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
nothing…
Where the hell is docker configuring its networks?!
In the end I figured out, that it is located at
/var/lib/docker/network/files/
. The shortest possible solution for me was to
stop the running docker part and remove everything within this directory:
sudo service docker stop
rm -rf /var/lib/docker/network/files/