Skip to content

Instantly share code, notes, and snippets.

@mikker
Created June 25, 2021 09:16
Show Gist options
  • Save mikker/29595729729f0280cad33e098e3e2eab to your computer and use it in GitHub Desktop.
Save mikker/29595729729f0280cad33e098e3e2eab to your computer and use it in GitHub Desktop.
Wait for Docker.app to be ready
#!/bin/bash
# Usage:
# $ ensure_docker_is_ready && docker-compose up
docker ps &> /dev/null
if [ $? -ne 0 ]; then
open -a Docker.app
else
exit 0
fi
echo -n "Waiting for Docker to be ready..."
sleep 5
until docker ps &> /dev/null; do
echo -n "."
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment