From b3c3f6ce35fb370e1fc26c1c37ad46719ce8abbc Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 29 Jan 2020 13:35:10 -0800 Subject: [PATCH] envsetup: Add a flag to launch docker with or without pseudo-tty Signed-off-by: Khem Raj --- envsetup.sh | 8 +++++++- local.sh.example | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/envsetup.sh b/envsetup.sh index 0e405acea..0254df888 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -474,6 +474,12 @@ dkr() { else shift fi + if [ "$DOCKER_PSEUDO_TTY" = "no" ]; then + PSEUDO_TTY="" + else + PSEUDO_TTY="-t" + fi + SSH_AUTH_DIR=~/ unset MAP_DL_DIR @@ -487,7 +493,7 @@ dkr() { SSH_AUTH_DIR=$(readlink -f $SSH_AUTH_SOCK) fi - docker run --rm -it \ + docker run --rm -i $PSEUDO_TTY \ -v $(pwd):$(pwd) \ -v ~/.ssh:/home/build/.ssh \ -v ~/.gitconfig:/home/build/.gitconfig \ diff --git a/local.sh.example b/local.sh.example index 27163ca8f..9720a196a 100644 --- a/local.sh.example +++ b/local.sh.example @@ -18,3 +18,10 @@ # configure docker container to run bitbake in #export DOCKER_REPO=yoedistro/yoe-build:buster + +# Flag to control docker launch with pseudo-tty +# when output is piped or redirected to files then +# then docker should be launched without tty +# otherwise it will emit all control characters into +# redirected log files, default is 'yes' +#export DOCKER_PSEUDO_TTY=no