From 81dd41546d7bca9a8c09e91ccab57436374cf21a Mon Sep 17 00:00:00 2001 From: David Hiendl Date: Tue, 6 Dec 2022 16:04:24 +0100 Subject: [PATCH] drone/ContainerImageDocker: replaced fixed wait time with ready-check loop --- drone/ContainerImageDocker.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drone/ContainerImageDocker.yml b/drone/ContainerImageDocker.yml index 9fcc8c6..d1fc4df 100644 --- a/drone/ContainerImageDocker.yml +++ b/drone/ContainerImageDocker.yml @@ -40,7 +40,6 @@ MERGE_REGISTRY_JSON: "true" DEBUG_STEP: "false" PUSH_TAGS: "true" - DOCKER_WAIT_START_SECONDS: "5" commands: - &ContainerImageDockerCommands | @@ -190,8 +189,12 @@ env fi - # give docker enough time to start - sleep $DOCKER_WAIT_START_SECONDS + # Wait until Docker daemon is running and has completed initialisation + while (! docker stats --no-stream >/dev/null 2>&1); do + # Docker takes a few seconds to initialize + echo "Waiting for Docker to launch..." + sleep 2 + done # start build echo $ALL_ARGS | xargs docker build