Created
February 6, 2019 19:57
-
-
Save bartimaeus/c39276281255578e76e20bf0ec9b03c8 to your computer and use it in GitHub Desktop.
Command used with tmuxinator to ensure that docker is running before starting the session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Open Docker, only if Docker not running | |
if (! docker ps -q 2>/dev/null ); then | |
# On Mac OS this would be the terminal command to launch Docker | |
open /Applications/Docker.app | |
echo "~> Starting Docker..." | |
echo "" | |
# Wait until Docker daemon is running and has completed initialisation | |
while (! docker ps -q 2>/dev/null ); do | |
# Docker takes a few seconds to initialize | |
sleep 2 | |
done | |
fi | |
echo "Docker is up and running!" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment