How to SSH to docker container running in Ubuntu Linux
Dung Do Tien
Dec 05 2020
382
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.
-
S0
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 rundocker ps
command to list all docker containers in your server, you will see NAMES column.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.