sonic-buildimage/scripts/wait_for_docker.sh
lguohan 40330bcbdf
[build]: wait up to 60 seconds for docker engine to start (#3067)
* [build]: wait 60 seconds for docker engine to start

On some platforms, it can take more than 1 second for docker
engine to start.

Signed-off-by: Guohan Lu <gulv@microsoft.com>
2019-06-22 14:40:05 -07:00

16 lines
199 B
Bash
Executable File

#!/bin/bash
total_time=$1
cnt=0
while [ $cnt -le $total_time ]; do
docker info 1>/dev/null
rv=$?
if [ $rv -eq 0 ]; then
exit 0
fi
sleep 1
cnt=$((cnt+1))
done
exit 1