【问题标题】:Why do I get "not a tty" when running "tty" in Docker?为什么在 Docker 中运行“tty”时得到“not a tty”?
【发布时间】:2017-01-14 06:46:24
【问题描述】:

为什么,在我将 CentOS 作为 Docker 容器启动后,当我运行 tty 时,我得到:

# tty
not a tty

not a tty的原因是什么?

【问题讨论】:

  • ...可能您的标准输入不是 TTY? (一个 tty 有一堆在其他文件描述符上不可用的带外交互 sysctl)。

标签: linux docker centos


【解决方案1】:

docker run 不会模拟 TTY,除非通过 -t 告知这样做。见https://docs.docker.com/engine/reference/run/#/foreground

【讨论】:

    猜你喜欢
    • 2015-09-16
    • 1970-01-01
    • 1970-01-01
    • 2012-09-10
    • 2022-09-28
    • 1970-01-01
    • 2020-08-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多