allo overriding docker in shellcheck

This commit is contained in:
Benjamin Elder 2021-03-06 13:28:58 -08:00
parent a0cd54a7f1
commit f643388cb4

View File

@ -25,6 +25,9 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
source "${KUBE_ROOT}/hack/lib/util.sh"
# allow overriding docker cli, which should work fine for this script
DOCKER="${DOCKER:-docker}"
# required version for this script, if not installed on the host we will
# use the official docker image instead. keep this in sync with SHELLCHECK_IMAGE
SHELLCHECK_VERSION="0.7.1"
@ -105,7 +108,7 @@ if ${HAVE_SHELLCHECK}; then
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" || res=$?
else
echo "Using shellcheck ${SHELLCHECK_VERSION} docker image."
docker run \
"${DOCKER}" run \
--rm -v "${KUBE_ROOT}:${KUBE_ROOT}" -w "${KUBE_ROOT}" \
"${SHELLCHECK_IMAGE}" \
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" || res=$?