How to SSH to docker container running in Ubuntu Linux

Dung Do Tien Dec 05 2020 402

I have a Linux server installed Ubuntu 18, Now I want from this sever access to a docker container is running in this server to execute some command but I don't know how to ssh to docker container?

Thank you for any suggestion.

Have 1 answer(s) found.
  • S

    Sandeep Kumar Dec 05 2020

    To access to docker container we have a syntax as below:

     docker exec -it <container name> /bin/bash 
    

    To get <Container name> you can run docker ps command to list all docker containers in your server, you will see NAMES column. 

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close