diff --git a/container/build.sh b/container/build.sh index a3889036..094acccc 100755 --- a/container/build.sh +++ b/container/build.sh @@ -517,6 +517,19 @@ function main() { local repository local suffix + # Require bash version 4 or higher. + if [[ ! "${BASH_VERSINFO:-0}" -ge 4 ]]; then + err "ERROR: Bash version must be 4 or greater" + exit 1 + fi + + # Require getopt version 2.32 or greater. + getopt_version=$(/usr/bin/getopt --version | cut -d' ' -f4 | cut -c1-4 | tr -d .) + if [[ ! "${getopt_version:-0}" -ge 232 ]]; then + err "ERROR: getopt version must be 2.32 or greater" + exit 1 + fi + declare -a docker_build_flags=() gnu_getopt_out=$(/usr/bin/getopt \