fix: register all containers for retirement on app stop

This ensures that unused docker images are _also_ removed. While this will mean a `ps:start` requires a rebuild in the case of a force-stop, it ensures we don't have unused images when destroying apps.
This commit is contained in:
Jose Diaz-Gonzalez
2021-10-09 15:06:25 -04:00
parent 5cfe7610b2
commit e53e8bb59f

View File

@@ -31,6 +31,10 @@ trigger-scheduler-docker-local-scheduler-stop() {
local DOKKU_APP_CIDS=$(get_app_container_ids "$APP")
if [[ -n "$DOKKU_APP_CIDS" ]]; then
for CID in $DOKKU_APP_CIDS; do
plugn trigger scheduler-register-retired "$APP" "$CID"
done
# shellcheck disable=SC2086
"$DOCKER_BIN" container rm --force $DOKKU_APP_CIDS >/dev/null 2>&1 || true
fi