Retry docker pull in tests if it fails.
#!/bin/sh
+# Pull the builder image with retries if it doesn't already exist.
+retries=0
+builder_image=$(grep FROM test/Dockerfile | awk '{print $2}')
+
+if ! docker inspect "$builder_image"; then
+ until docker pull "$builder_image"; do
+ if [ retries -eq 3 ]; then
+ echo "Giving up downloading builder image, failing build."
+ exit 1
+ fi
+ echo "Docker pull failed, retrying."
+ ((retries++))
+ sleep 1
+ done
+fi
+
docker build -f test/Dockerfile -t kudo-test .
if [ $? -eq 0 ]
then
