Is it possible to start a shell session in a running container (without ssh)

后端 未结 15 1171
滥情空心
滥情空心 2020-11-29 14:33

I was naively expecting this command to run a bash shell in a running container :

docker run \"id of running container\" /bin/bash

it look

15条回答
  •  借酒劲吻你
    2020-11-29 15:05

    Keep an eye on this pull request: https://github.com/docker/docker/pull/7409

    Which implements the forthcoming docker exec utility. When this is available it should be possible to e.g. start and stop the ssh service inside a running container.

    There is also nsinit to do this: "nsinit provides a handy way to access a shell inside a running container's namespace", but it looks difficult to get running. https://gist.github.com/ubergarm/ed42ebbea293350c30a6

提交回复
热议问题