Merge pull request #6419 from docker/6416-runsh-no-input

Always connect Compose container to stdin
This commit is contained in:
Joffrey F 2018-12-20 08:47:24 +09:00 committed by GitHub
commit 6e697c3b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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"