From d35642f032772c9a681b6e0b061787229ea70fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neven=20Kaji=C4=87?= Date: Wed, 5 Jul 2023 10:21:56 +0200 Subject: [PATCH] bin/docker-start initial commit --- compose/bin/docker-start | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 compose/bin/docker-start diff --git a/compose/bin/docker-start b/compose/bin/docker-start new file mode 100644 index 000000000..b049a1bf3 --- /dev/null +++ b/compose/bin/docker-start @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# https://stackoverflow.com/a/48843074 +# Open Docker, only if is not running +if (! docker stats --no-stream &> /dev/null ); then + # On Mac OS this would be the terminal command to launch Docker + open /Applications/Docker.app + #Wait until Docker daemon is running and has completed initialisation + while (! docker stats --no-stream &> /dev/null ); do + # Docker takes a few seconds to initialize + echo "* Waiting for Docker to launch..." + sleep 2 + done +fi