Skip to content

Instantly share code, notes, and snippets.

View michaeldlfx's full-sized avatar

Michael de la Fontaine michaeldlfx

View GitHub Profile
@michaeldlfx
michaeldlfx / dockerReady.sh
Created July 12, 2020 14:24
[MacOS] Start docker if daemon is not running
# This snippet works well as part of a .bash_profile file.
# It's based on this StackOverflow post: https://stackoverflow.com/a/48843074/11488212
# This docker daemon is a resource hog, and doesn't always need to be running imho.
# I predent the below declared alias "dr" to all my docker aliases to start up the docker daemon if it's not already running.
# This way, I don't get the annoying 'ERROR: Couldn't connect to Docker daemon. You might need to start Docker' message anymore.
# Example usage: "alias dcu="dr ; docker-compose up"
alias dr="dockerReady"