docker exec -it 返回“无法在非 tty 输入上启用 tty 模式" [英] docker exec -it returns "cannot enable tty mode on non tty input"
本文介绍了docker exec -it 返回“无法在非 tty 输入上启用 tty 模式"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
docker exec -it
命令返回以下错误无法在非 tty 输入上启用 tty 模式"
docker exec -it
command returns following error "cannot enable tty mode on non tty input"
level="fatal" msg="cannot enable tty mode on non tty input"
我在 centos box 6.6 上运行 docker(1.4.1).我正在尝试执行以下命令docker exec -it containerName/bin/bash
但我收到以下错误
I am running docker(1.4.1) on centos box 6.6.
I am trying to execute the following command
docker exec -it containerName /bin/bash
but I am getting following error
level="fatal" msg="cannot enable tty mode on non tty input"
推荐答案
运行 docker exec -i
而不是 docker exec -it
解决了我的问题.事实上,我的脚本是由 CRONTAB 启动的,它不是终端.
Running docker exec -i
instead of docker exec -it
fixed my issue. Indeed, my script was launched by CRONTAB which isn't a terminal.
提醒一下:
Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
Run a command in a running container
-i, --interactive=false Keep STDIN open even if not attached
-t, --tty=false Allocate a pseudo-TTY
这篇关于docker exec -it 返回“无法在非 tty 输入上启用 tty 模式"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文