gpt4 book ai didi

linux - 为什么在 Docker 中运行 "not a tty"时得到 "tty"?

转载 作者:太空宇宙 更新时间:2023-11-04 09:21:17 25 4
gpt4 key购买 nike

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

# tty
not a tty

不是 tty 的原因是什么?

最佳答案

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

关于linux - 为什么在 Docker 中运行 "not a tty"时得到 "tty"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41625196/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com