This change converts existing CHECKS files into a healthchecks key that is understood by 'docker-container-healthchecker'. This tool supports a number of different types of container healthchecks - command, http, uptime - and can perform healthchecks against non-web processes. The use of the old CHECKS file is now deprecated, and will be removed in the next minor version. Users can use the 'docker-container-healthchecker' to convert existing CHECKS files to the new format automatically. Closes #2760
21 lines
546 B
Bash
Executable File
21 lines
546 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $TRACE ]] && set -x
|
|
|
|
main() {
|
|
declare desc="re-runs docker-container-healthchecker commands as sudo"
|
|
local DOCKER_CONTAINER_HEALTHCHECKER_BIN=""
|
|
if [[ -x "/usr/bin/docker-container-healthchecker" ]]; then
|
|
DOCKER_CONTAINER_HEALTHCHECKER_BIN="/usr/bin/docker-container-healthchecker"
|
|
fi
|
|
|
|
if [[ -z "$DOCKER_CONTAINER_HEALTHCHECKER_BIN" ]]; then
|
|
echo "! No docker-container-healthchecker binary found" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
sudo -E "$DOCKER_CONTAINER_HEALTHCHECKER_BIN" "$@"
|
|
}
|
|
|
|
main "$@"
|