From ff56eef454b8838104ab820e700440f346940636 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 23 Jan 2020 10:56:36 +0100 Subject: [PATCH] Check that container is running before starting rest server --- scripts/cosm/start.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/cosm/start.sh b/scripts/cosm/start.sh index 189dfe15..a3d91c2a 100755 --- a/scripts/cosm/start.sh +++ b/scripts/cosm/start.sh @@ -29,6 +29,13 @@ echo "wasmd running and logging into $WASMD_LOGFILE" sleep 10 +if [ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME")" != "true" ]; then + echo "Container named '$CONTAINER_NAME' not running. We cannot continue." \ + "This can happen when 'docker run' needs too long to download and start." \ + "It might be worth retrying this step once the image is in the local docker cache." + exit 1 +fi + docker exec "$CONTAINER_NAME" \ wasmcli rest-server \ --node tcp://localhost:26657 \