diff --git a/script/wrapdocker b/script/wrapdocker index 2e07bdadf..119e88df4 100755 --- a/script/wrapdocker +++ b/script/wrapdocker @@ -8,9 +8,16 @@ fi # delete it so that docker can start. rm -rf /var/run/docker.pid docker -d $DOCKER_DAEMON_ARGS &>/var/log/docker.log & +docker_pid=$! >&2 echo "Waiting for Docker to start..." while ! docker ps &>/dev/null; do + if ! kill -0 "$docker_pid" &>/dev/null; then + >&2 echo "Docker failed to start" + cat /var/log/docker.log + exit 1 + fi + sleep 1 done