FIX: Automatically retry image pull once (#468)

FIX: Automatically retry image pull once (#468)

diff --git a/launcher b/launcher
index 96b8869..2a61c2f 100755
--- a/launcher
+++ b/launcher
@@ -144,6 +144,11 @@ install_docker() {
   exit 1
 }
 
+pull_image() {
+  # Add a single retry to work around dockerhub TLS errors
+  $docker_path pull $image || $docker_path pull image
+}
+
 check_prereqs() {
 
   if [ -z $docker_path ]; then
@@ -196,6 +201,8 @@ check_prereqs() {
     echo
     echo "Please be patient"
     echo
+
+    pull_image
   fi
 
   # 5. running recommended git version
@@ -657,7 +664,7 @@ run_bootstrap() {
 
   # Is the image available?
   # If not, pull it here so the user is aware what's happening.
-  $docker_path history $image >/dev/null 2>&1 || $docker_path pull $image
+  $docker_path history $image >/dev/null 2>&1 || pull_image
 
   set_template_info
 

GitHub sha: a554d3dc

This commit appears in #468 which was merged by SamSaffron.

-  $docker_path pull $image || $docker_path pull image
+  $docker_path pull $image || $docker_path pull $image

Do we need another $ here?

3 Likes

Fixed in commit 94360a4

2 Likes