blob: b213fb40c0fffcb600b4c04a216ee0e64a14a38f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
retry_count=0
docker_ok="false"
until [ "${docker_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
do
if [ "${retry_count}" -eq "3" ]; then
echo "Starting docker after 3 retries..."
/usr/local/share/docker-init.sh
fi
set +e
docker info > /dev/null 2>&1 && docker_ok="true"
if [ "${docker_ok}" != "true" ]; then
echo "(*) Failed to start docker, retrying in 5s... Retry count: ${retry_count}"
retry_count=`expr $retry_count + 1`
sleep 1s
fi
set -e
done
|