From fee5261014ff1f0a867e2f871a82cc3ade78e3cd Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 19 Dec 2018 00:24:33 -0800 Subject: [PATCH] Always connect Compose container to stdin Signed-off-by: Joffrey F --- script/run/run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/run/run.sh b/script/run/run.sh index d3069ff78..cc36e4751 100755 --- a/script/run/run.sh +++ b/script/run/run.sh @@ -47,14 +47,14 @@ if [ -n "$HOME" ]; then fi # Only allocate tty if we detect one -if [ -t 0 ]; then - if [ -t 1 ]; then +if [ -t 0 -a -t 1 ]; then DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -t" - fi -else - DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i" fi +# Always set -i to support piped and terminal input in run/exec +DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i" + + # Handle userns security if [ ! -z "$(docker info 2>/dev/null | grep userns)" ]; then DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS --userns=host"