diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index 2471367..205755a 100755 --- a/bin/entrypoint.sh +++ b/bin/entrypoint.sh @@ -7,7 +7,7 @@ export FIRST=${FIRST:-""} if [ ! -e $CONFIG ]; then # create a new docker image with the bootstrapped version of your cluster ./bin/spinner "Bootstrapping your hind cluster..." /app/bin/bootstrap.sh - + ./bin/spinner 'cleanly shutting down' /app/bin/shutdown.sh ./bin/spinner 'committing bootstrapped image' podman commit hind hind diff --git a/bin/shutdown.sh b/bin/shutdown.sh new file mode 100755 index 0000000..97beb80 --- /dev/null +++ b/bin/shutdown.sh @@ -0,0 +1,11 @@ +#!/bin/zsh -eu + +# cleanly shutdown so we dont have a dangling supervisord socket at `podman commit` time + +cd /etc/supervisor +supervisorctl stop nomad +supervisorctl stop consul +supervisorctl stop consul-template +supervisorctl stop caddy-restarter +supervisorctl shutdown +sleep 5