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

后端 未结 15 1205
滥情空心
滥情空心 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:06

    There are two ways.

    With attach

    $ sudo docker attach 665b4a1e17b6 #by ID
    

    With exec

    $ sudo docker exec - -t 665b4a1e17b6 #by ID
    

提交回复
热议问题