How do you attach and detach from Docker's process?

后端 未结 15 847
情书的邮戳
情书的邮戳 2020-11-29 14:42

I can attach to a docker process but Ctrl+c doesn\'t work to detach from it. exit basically halts the process.

What\'s the recomm

15条回答
  •  时光取名叫无心
    2020-11-29 14:47

    To detach the tty without exiting the shell, use the escape sequence Ctrl+P followed by Ctrl+Q. More details here.

    Additional info from this source:

    • docker run -t -i → can be detached with ^P^Qand reattached with docker attach
    • docker run -i → cannot be detached with ^P^Q; will disrupt stdin
    • docker run → cannot be detached with ^P^Q; can SIGKILL client; can reattach with docker attach

提交回复
热议问题