GCI: Remove /var/lib/docker/network

This avoids running into corrupt network checkpoint issues.
This commit is contained in:
Yu-Ju Hong 2016-11-28 14:26:32 -08:00
parent e6c57c6569
commit 47c3b05fa3

View File

@ -409,9 +409,22 @@ function assemble-docker-flags {
fi fi
echo "DOCKER_OPTS=\"${docker_opts} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker echo "DOCKER_OPTS=\"${docker_opts} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker
# If using a network plugin, we need to explicitly restart docker daemon, because
# kubelet will not do it.
if [[ "${use_net_plugin}" == "true" ]]; then if [[ "${use_net_plugin}" == "true" ]]; then
# If using a network plugin, extend the docker configuration to always remove
# the network checkpoint to avoid corrupt checkpoints.
# (https://github.com/docker/docker/issues/18283).
echo "Extend the default docker.service configuration"
mkdir -p /etc/systemd/system/docker.service.d
cat <<EOF >/etc/systemd/system/docker.service.d/01network.conf
[Service]
ExecStartPre=/bin/sh -x -c "rm -rf /var/lib/docker/network"
EOF
systemctl daemon-reload
# If using a network plugin, we need to explicitly restart docker daemon, because
# kubelet will not do it.
echo "Docker command line is updated. Restart docker to pick it up" echo "Docker command line is updated. Restart docker to pick it up"
systemctl restart docker systemctl restart docker
fi fi