浏览代码

Always connect Compose container to stdin

Signed-off-by: Joffrey F <[email protected]>
Joffrey F 7 年之前
父节点
当前提交
fee5261014
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      script/run/run.sh

+ 5 - 5
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"