From bdb40d339e5ab6fd2af1aaaca5d242251bc1ebe8 Mon Sep 17 00:00:00 2001 From: postmannen Date: Wed, 8 Dec 2021 08:21:09 +0100 Subject: [PATCH] added check for docker image to wrapper --- scripts/nats-server/wrapper-docker-compose.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/nats-server/wrapper-docker-compose.sh b/scripts/nats-server/wrapper-docker-compose.sh index c0fb9da..c7fc7d6 100755 --- a/scripts/nats-server/wrapper-docker-compose.sh +++ b/scripts/nats-server/wrapper-docker-compose.sh @@ -5,13 +5,21 @@ FQDN=$1 +if docker inspect --type=image certupdater:0.1.0 &>/dev/null; then + echo " * ok, certupdater docker image found" +else + echo " * No docker image for certupdater found." + echo " * A docker image of certupdater need to be present on the host." + echo " * Follow the instructions at https://github.com/RaaLabs/certupdater" + echo " * to build and install it as a docker image." + exit 1 +fi + if docker run -it --rm -v "$PWD:/certs/:rw" -p 80:80 -p 443:443 -e DAEMON=false -e USER_FOLDER=/certs -e PROD=false -e DOMAIN="$FQDN" certupdater:0.1.0; then echo " * successfully generated LetsEncrypt certificate" else echo " * failed to generate LetsEncrypt certificate." - echo " * a docker image of cert updater need to be present on the host." - echo " * Follow the instructions at https://github.com/RaaLabs/certupdater" - echo " * to install it as a docker image." + exit 1 fi LE_CRT=$PWD/$FQDN/$FQDN.crt