From 94be6a9e3cec6d2c1ebd51ba1cba24df600cbd06 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 26 Oct 2018 15:32:34 -0700 Subject: [PATCH] Pull images in installer.sh This way if the network is not working, then the update will just fail and use the old version This also tags the addon images with the semver properly --- baseimage/initializeBaseUbuntuImage.sh | 1 + scripts/installer.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/baseimage/initializeBaseUbuntuImage.sh b/baseimage/initializeBaseUbuntuImage.sh index ba12d6d05..715373110 100644 --- a/baseimage/initializeBaseUbuntuImage.sh +++ b/baseimage/initializeBaseUbuntuImage.sh @@ -93,6 +93,7 @@ images=$(node -e "var i = require('${arg_infraversionpath}/infra_version.js'); c echo -e "\tPulling docker images: ${images}" for image in ${images}; do docker pull "${image}" + docker pull "${image%@sha256:*}" # this will tag the image for readability done echo "==> Install collectd" diff --git a/scripts/installer.sh b/scripts/installer.sh index 9570957df..498c75099 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -81,6 +81,15 @@ if [[ ${try} -eq 10 ]]; then exit 4 fi +echo "==> installer: downloading new addon images" +images=$(node -e "var i = require('${box_src_tmp_dir}/src/infra_version.js'); console.log(i.baseImages.join(' '), Object.keys(i.images).map(function (x) { return i.images[x].tag; }).join(' '));") + +echo -e "\tPulling docker images: ${images}" +for image in ${images}; do + docker pull "${image}" # this pulls the image using the sha256 + docker pull "${image%@sha256:*}" # this will tag the image for readability +done + echo "==> installer: update cloudron-syslog" CLOUDRON_SYSLOG_DIR=/usr/local/cloudron-syslog CLOUDRON_SYSLOG="${CLOUDRON_SYSLOG_DIR}/bin/cloudron-syslog"