Skip to content

Instantly share code, notes, and snippets.

@mattieb
Created Sep 2, 2022
Embed
What would you like to do?
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