Docker - 使用新的TTY输入运行容器 [英] Docker - Enter Running Container with new TTY
问题描述
是否可以将另一个tty附加到正在运行的容器?可能的是,我可以利用Docker实际上只是围绕LXC容器的事实吗?我试过 sudo lxc-console -n [container-id] -t [1-4]
,但似乎只有一个tty可用,那就是一个运行apache守护进程。也许有一种方法可以在构建期间启用多个lxc控制台?
我宁愿不使用openssh服务配置和构建容器,如果
使用docker 1.3,有一个新的命令 docker exec
。这可以让您进入正在运行的码头服务器:
docker exec -it [container-id] bash
I have a container that is running the Apache service in the foreground. I would like to be able to access the container from another shell in order to "poke around" inside it and examine the files. At the moment, if I attach to the container, I am left looking at the Apache daemon and cannot run any commands.
Is it possible to attach another tty to a running container? Possibly, I can take advantage of the fact that Docker is actually just wrapping around LXC containers? I have tried sudo lxc-console -n [container-id] -t [1-4]
but it appears that only one tty is made available and that is the one running the apache daemon. Perhaps there is a way to enable multiple lxc consoles during the build?
I would rather not configure and build the container with an openssh service if possible.
With docker 1.3, there is a new command docker exec
. This allows you to enter a running docker:
docker exec -it [container-id] bash
这篇关于Docker - 使用新的TTY输入运行容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!