diff --git a/docker/common/run.sh b/docker/common/run.sh index 8a702874..9455208e 100755 --- a/docker/common/run.sh +++ b/docker/common/run.sh @@ -31,6 +31,12 @@ ARGS=( ) test -t 1 && ARGS+=("-t") +# Extra options for 'docker run', split on whitespace, e.g. '--network host' +if [ -n "${DOCKER_EXTRA_ARGS:-}" ]; then + read -r -a EXTRA_ARGS <<< "${DOCKER_EXTRA_ARGS}" + ARGS+=("${EXTRA_ARGS[@]}") +fi + if [ "${1}" = "--pull" ]; then ARGS+=(--pull always) shift diff --git a/docker/selftests/wrapper.sh b/docker/selftests/wrapper.sh index 80eff143..8519bb0d 100755 --- a/docker/selftests/wrapper.sh +++ b/docker/selftests/wrapper.sh @@ -5,17 +5,4 @@ # after the commands to wrap -- e.g. 'make' and 'vng' -- pointing to this script # in a directory placed at the beginning of $PATH. -cmd=("$(basename "${0}")") - -# 'vng --run' needs root privileges to start some VM in the container -if [ "${cmd[0]}" = "vng" ]; then - for arg in "${@}"; do - [ "${arg}" = "--" ] && break - if [ "${arg}" = "--run" ] || [ "${arg}" = "-r" ]; then - cmd=(sudo "${cmd[@]}") - break - fi - done -fi - -exec "$(dirname "$(realpath "${0}")")/run.sh" "${cmd[@]}" "${@}" +exec "$(dirname "$(realpath "${0}")")/run.sh" "$(basename "${0}")" "${@}"