Skip to content

Instantly share code, notes, and snippets.

@ksanderer
Created October 18, 2018 12:37
Show Gist options
  • Save ksanderer/c60ec68b8d1834c598d80266dd5b6584 to your computer and use it in GitHub Desktop.
Save ksanderer/c60ec68b8d1834c598d80266dd5b6584 to your computer and use it in GitHub Desktop.
Simple script to wait until docker is ready
#!/bin/bash
# Usage:
# > while ! ./wait-fordocker.sh ; do sleep 1 ; done
rep=$(curl -s --unix-socket /var/run/docker.sock http://ping > /dev/null)
status=$?
if [ "$status" == "7" ]; then
echo 'not connected'
sleep 1
exit 1
fi
echo 'connected'
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment