Created
September 2, 2022 15:43
-
-
Save atomicmattie/c7c946e50b4bc02550b5c767bd097d84 to your computer and use it in GitHub Desktop.
starts Docker Desktop on macOS on-demand
This file contains 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/ksh | |
# | |
# Starts Docker Desktop on macOS on-demand. | |
# | |
# Put this in your PATH before `/usr/local/bin/desktop`. | |
# | |
set -e | |
if ! /usr/local/bin/docker system info >/dev/null 2>/dev/null | |
then | |
open /Applications/Docker.app | |
echo -n 'Starting Docker Desktop' | |
while ! /usr/local/bin/docker system info >/dev/null 2>/dev/null | |
do | |
echo -n '.' | |
sleep 1 | |
done | |
echo 'done.' | |
fi | |
exec /usr/local/bin/docker "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment