Skip to content

Commit 0132c9a

Browse files
committed
[7.8] Automatically retry 'docker pull' on CI
1 parent 872dff8 commit 0132c9a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.ci/run-elasticsearch.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ fi
157157

158158
echo -e "\033[34;1mINFO:\033[0m Starting container $NODE_NAME \033[0m"
159159

160+
# Pull the container, retry on failures up to 5 times with
161+
# short delays between each attempt. Fixes most transient network errors.
162+
docker_pull_attempts=0
163+
until [ "$docker_pull_attempts" -ge 5 ]
164+
do
165+
docker pull docker.elastic.co/elasticsearch/"$ELASTICSEARCH_VERSION" && break
166+
docker_pull_attempts=$((docker_pull_attempts+1))
167+
sleep 10
168+
done
169+
160170
set -x
161171
docker run \
162172
--name "$NODE_NAME" \

0 commit comments

Comments
 (0)