docker exec -it
命令返回以下错误“无法在非 tty 输入上启用 tty 模式”
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
但我收到以下错误
level="fatal" msg="cannot enable tty mode on non tty input"
最佳答案
运行 docker exec -i
而不是 docker exec -it
解决了我的问题。事实上,我的脚本是由 CRONTAB 启动的,它不是终端。
提醒一下:
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
关于centos - docker exec -it 返回 "cannot enable tty mode on non tty input",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29380344/