Skip to content

Instantly share code, notes, and snippets.

@bartimaeus
Created February 6, 2019 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bartimaeus/c39276281255578e76e20bf0ec9b03c8 to your computer and use it in GitHub Desktop.
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
#!/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