简体   繁体   English

无法退出 docker start 的交互模式

[英]Not able to exit from interactive mode of docker start

I started a container using the below command connecting to linux server using putty.我使用以下命令启动了一个容器,使用 putty 连接到 linux 服务器。

docker start -i <containerid>

but I am not able exit from it and get back to command line, without closing the putty.但我无法退出它并返回命令行,而不关闭腻子。

你可以从你的终端做:

  • exit
  • ctrl+C
  • ctrl+D
  • Start the container docker start <container-id>启动容器docker start <container-id>
  • Set the containers to run in daemon mode docker exec -it -d <container-id> bash or docker exec -d <container-id> bash将容器设置为以守护程序模式运行docker exec -it -d <container-id> bashdocker exec -d <container-id> bash
  • Enter the running container docker exec -it <container-id> bash进入正在运行的容器docker exec -it <container-id> bash
  • Exit the interactive mode by typing exit输入exit交互模式
  • Type docker ps -a , the container will still be running, to stop it use docker stop <container-id>键入docker ps -a ,容器仍将运行,要停止它使用docker stop <container-id>

Example to quit interactive mode and keep the container alive:退出交互模式并保持容器活动的示例:

样本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM