docker: run interactively only if we have a TTY
When building packages in containers, we pass options to docker. However, when running in a noninteractive environment such as GitHub Actions, we can't use the -i option, since standard input will not be a TTY and docker will consequently fail. Check for a TTY and pass the -i option only if one is present.
This commit is contained in:
parent
b1dad49a07
commit
1a5eaa6f47
@ -69,7 +69,11 @@ for IMAGE_NAME in "${IMAGES[@]}"; do
|
||||
fi
|
||||
|
||||
#It CAN'T be empty () with set -u... So I put some defaults in here
|
||||
OTHER_OPTIONS=("-it")
|
||||
OTHER_OPTIONS=("-t")
|
||||
|
||||
if tty >/dev/null; then
|
||||
OTHER_OPTIONS+=("-i")
|
||||
fi
|
||||
|
||||
if [ "${AUTO_REMOVE-1}" == "1" ]; then
|
||||
OTHER_OPTIONS+=("--rm")
|
||||
|
Loading…
Reference in New Issue
Block a user