Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker/common/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions docker/selftests/wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}")" "${@}"
Loading