[7.x] Automatically retry 'docker pull' on CI
This commit is contained in:
committed by
Seth Michael Larson
parent
33c1650b64
commit
eaa8334e54
@@ -157,6 +157,16 @@ fi
|
||||
|
||||
echo -e "\033[34;1mINFO:\033[0m Starting container $NODE_NAME \033[0m"
|
||||
|
||||
# Pull the container, retry on failures up to 5 times with
|
||||
# short delays between each attempt. Fixes most transient network errors.
|
||||
docker_pull_attempts=0
|
||||
until [ "$docker_pull_attempts" -ge 5 ]
|
||||
do
|
||||
docker pull docker.elastic.co/elasticsearch/"$ELASTICSEARCH_VERSION" && break
|
||||
docker_pull_attempts=$((docker_pull_attempts+1))
|
||||
sleep 10
|
||||
done
|
||||
|
||||
set -x
|
||||
docker run \
|
||||
--name "$NODE_NAME" \
|
||||
|
||||
Reference in New Issue
Block a user