Skip to content

Instantly share code, notes, and snippets.

@atomicmattie
Created September 2, 2022 15:43
Show Gist options
  • Save atomicmattie/c7c946e50b4bc02550b5c767bd097d84 to your computer and use it in GitHub Desktop.
Save atomicmattie/c7c946e50b4bc02550b5c767bd097d84 to your computer and use it in GitHub Desktop.
starts Docker Desktop on macOS on-demand
#!/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