What does it mean to attach a tty/std-in-out to dockers or lxc?

后端 未结 4 548
无人及你
无人及你 2020-12-23 09:09

I read some docker docs and I do not understand what it might mean to

  • attach a tty
  • attach std-in and std-out

for these purposes, I see

4条回答
  •  自闭症患者
    2020-12-23 09:34

    stdin, stdout, and ttys are related concepts. stdin and stdout are the input and output streams of a process. A pseudo terminal (also known as a tty or a pts) connects a user's "terminal" with the stdin and stdout stream, commonly (but not necessarily) through a shell such as bash. I use quotes around "terminal" since we really don't use a terminal in the same sense today.

    In the case of docker, you'll often use -t and -i together when you run processes in interactive mode, such as when starting a bash shell. In the case of the shell you want to be able to issue commands and read the output.

    The code docker uses to attach stdout/stdin has all the dirty details.

提交回复
热议问题