mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
This change allows operators to specify a DOCKER_BIN environment variable. This will specify a binary to run when executing docker, which is useful in cases where the 'docker' command being run must be modified in a way that would otherwise be invasive to Dokku, but minimalistic if done within a wrapper.
26 lines
734 B
Bash
Executable File
26 lines
734 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
|
|
apps_pre_delete() {
|
|
declare desc="apps pre-delete plugin trigger"
|
|
local trigger="apps_pre_delete"
|
|
local APP="$1"
|
|
local IMAGE_TAG="$2"
|
|
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
|
local CACHE_DIR="$DOKKU_ROOT/$APP/cache"
|
|
local CACHE_HOST_DIR="$DOKKU_HOST_ROOT/$APP/cache"
|
|
verify_app_name "$APP"
|
|
|
|
if ! is_image_herokuish_based "$IMAGE"; then
|
|
return
|
|
fi
|
|
|
|
if [[ -d $CACHE_DIR ]]; then
|
|
"$DOCKER_BIN" run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_HOST_DIR:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
|
fi
|
|
}
|
|
|
|
apps_pre_delete "$@"
|