Created
July 14, 2023 13:22
-
-
Save TimidRobot/8a4f64e764b0858c8e4842c985b11b61 to your computer and use it in GitHub Desktop.
"Docker Up" helper script
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/bash | |
set -o errtrace | |
set -o nounset | |
printf "\e[1m\e[7m %-80s\e[0m\n" 'Ensuring docker is running' | |
if [[ -S /var/run/docker.sock ]] | |
then | |
echo . | |
else | |
open -a Docker | |
while [[ ! -S /var/run/docker.sock ]] | |
do | |
echo -n . | |
sleep 0.2 | |
done | |
for x in {1..15} | |
do | |
echo -n . | |
sleep 0.2 | |
done | |
echo | |
fi | |
echo | |
printf "\e[1m\e[7m %-80s\e[0m\n" 'Run docker compose up' | |
docker compose up | |
sleep 0.2 | |
echo | |
printf "\e[1m\e[7m %-80s\e[0m\n" 'Run docker compose down' | |
docker compose down | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment