Skip to content

Commit

Permalink
Workaround for Docker 1.11.2 startup issue
Browse files Browse the repository at this point in the history
On a percentage of DC/OS agents (~5%) with Docker 1.11.2, the Daemon
will fail to start up with the following error:

> Error starting daemon: Error initializing network controller: Error
> creating default "bridge" network: failed to allocate gateway
> (172.17.0.1): Address already in use

This seems to be related to a Docker bug around the network controller
initialization, where the controller has allocated an ip pool and
persisted some state but not all of it. See:

* moby/moby#22834
* moby/moby#23078

This fix simply removes the docker0 interface if it exists before
starting the Docker daemon. This fix will need to be re-evaluated if we
want to enable the 1.12+ containerd live-restore like Docker options as
discussed in:

* https://docs.docker.com/engine/admin/live-restore/
* moby/moby#2658
  • Loading branch information
Jeremy Lingmann committed Aug 29, 2016
1 parent d906dbb commit ce3552a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloud_images/centos7/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ docker_service_d=/etc/systemd/system/docker.service.d
mkdir -p "$docker_service_d"
cat << 'EOF' > "${docker_service_d}/execstart.conf"
[Service]
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --graph=/var/lib/docker --storage-driver=overlay
EOF
Expand Down
1 change: 1 addition & 0 deletions gen/azure/cloud-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ root:
Restart=always
StartLimitInterval=0
RestartSec=15
ExecStartPre=-/sbin/ip link del docker0
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay
- path: /etc/systemd/system/docker.socket
Expand Down

0 comments on commit ce3552a

Please sign in to comment.