Detilium
Detilium

Reputation: 3026

How to SSH into running container using docker

I'm trying to SSH into my running Jenkins VM which I have created with a Dockerfile.

I need to see the filestructure and copy the /var/lib/jenkins folder out to my shared folder.

How do I achieve getting into the VM?

Upvotes: 1

Views: 321

Answers (1)

user2915097
user2915097

Reputation: 32216

Do not use SSH, simply a docker exec -it your_container bashand then issue the commands you want. See the doc https://docs.docker.com/reference/commandline/cli/#exec and if you have an old verison of docker use nsenter https://github.com/jpetazzo/nsenter

Upvotes: 4

Related Questions