From f2c232bb1013f6734f9556a67766373d08473c5b Mon Sep 17 00:00:00 2001 From: Nick Jones Date: Tue, 1 Dec 2015 16:20:36 +0000 Subject: [PATCH] Only allocate a tty if we detect one Signed-off-by: Nick Jones --- script/run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/run.sh b/script/run.sh index 9563b2e9c..6990799c5 100755 --- a/script/run.sh +++ b/script/run.sh @@ -43,5 +43,11 @@ if [ -n "$HOME" ]; then VOLUMES="$VOLUMES -v $HOME:$HOME" fi +# Only allocate tty if we detect one +if [ -t 1 ]; then + DOCKER_RUN_OPTIONS="-ti" +else + DOCKER_RUN_OPTIONS="-i" +fi -exec docker run --rm -ti $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w $(pwd) $IMAGE $@ +exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w $(pwd) $IMAGE $@