title: Docker's `docker0` device dies repeatedly (`inet addr` disappears)
body: <p>I'm running <code>Docker version 1.4.1, build 5bc2ff8</code> on Ubuntu 14.04. When I <code>docker run</code> any container, after a few minutes my <code>docker0</code> bridge "dies", and the container stops being able to reach the network. Before the connection dies, running <code>ifconfig</code> reports a <code>docker0</code> device with an <code>inet addr</code> like:</p>
  
  <pre><code>docker0   Link encap:Ethernet  HWaddr 56:84:7a:fe:97:99  
            inet addr:172.17.42.1  Bcast:0.0.0.0  Mask:255.255.0.0
            inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            [... etc.]
  </code></pre>
  
  <p>But after the connection dies, <code>ifconfig</code> shows that the ipv4 address has gone away:</p>
  
  <pre><code>docker0   Link encap:Ethernet  HWaddr 56:84:7a:fe:97:99 
            inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:8116 errors:0 dropped:0 overruns:0 frame:0
            TX packets:15995 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0 
            RX bytes:2444859 (2.4 MB)  TX bytes:17440729 (17.4 MB)
  </code></pre>
  
  <p>Restarting docker, e.g. with <code>sudo service docker restart</code>, brings the device back up -- but all my containers die and the problem starts over again. I can't reliably get anything to run for more than a few minutes at a time. Not long enough to even complete a <code>docker build</code> for most projects.</p>
  
  <ol>
  <li>What could be causing this?</li>
  <li>How can I diagnose it?</li>
  <li>What are some possible solutions?</li>
  </ol>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p>Update: I can reliably trigger this <code>docker0</code>-dropping behavior simply by starting a container with <code>docker run -t -i ubuntu /bin/bash</code>, and then exiting with <code>ctrl-d</code>. When I do so, here's what I see in <code>/var/log/syslog</code></p>
  
  <pre><code>myhost kernel:  docker0: port 1(veth80ddeaf) entered disabled state
  myhost kernel:  device veth80ddeaf left promiscuous mode
  myhost kernel:  docker0: port 1(veth80ddeaf) entered disabled state
  '
  
  myhost dhclient: Internet Systems Consortium DHCP Client 4.2.4
  myhost dhclient: Copyright 2004-2012 Internet Systems Consortium.
  myhost dhclient: All rights reserved.
  myhost dhclient: For info, please visit https://www.isc.org/software/dhcp/
  myhost dhclient: 
  myhost dhclient: Listening on LPF/docker0/56:84:7a:fe:97:99
  myhost dhclient: Sending on   LPF/docker0/56:84:7a:fe:97:99
  myhost dhclient: Sending on   Socket/fallback
  myhost kernel:  IPv6: ADDRCONF(NETDEV_UP): docker0: link is not ready
  </code></pre>
  
  <hr>
  
  <p>Update #2: The frequency of failure seems to depend on how long the container runs. For example:</p>
  
  <pre><code>docker run -i -t  ubuntu   sleep 0
  --&gt; `docker0` "survives" ~100% of the time
  
  docker run -i -t  ubuntu   sleep 1
  --&gt; `docker0` survives ~80% of the time
  
  docker run -i -t  ubuntu   sleep 5
  --&gt; `docker0` survives ~0% of the time
  </code></pre>