Accessing containers.

624    Asked by JasmineForsyth in Devops , Asked on Nov 28, 2019
Answered by Jasmine Forsyth

A running container can be accessed using docker exec command.

Docker exec -it

The above command will provide an interactive shell to execute commands within running container.

So, if you have a container id say “udweffnwejifniwefj” and want “bash” shell for interaction then use below command

Docker exec -it udweffnwejifniwefj /bin/bash

and above will give you a /bin/bash for container - udweffnwejifniwefj



Your Answer

Interviews

Parent Categories