You can connect docker container in many ways.
Most simple way is using docker exec
command.
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
Also, you can use docker attach
command too.
docker attach <container-name>
But you can use ssh
for connecting running container.
First, you have to know IP address of the container. You can know by this command
# You can know instance_name by
docker container ls
# And add your instance name below
export INSTANCE_NAME="your_instance_name"
docker inspect --format='' $INSTANCE_NAME
172.17.0.2
Then you can connect docker container by
ssh root@172.17.0.2
'backend > docker' 카테고리의 다른 글
docker: CMD와 ENTRYPOINT 다른점 (0) | 2020.12.05 |
---|---|
Docker : run ufw, iptables command in docker container (0) | 2018.10.11 |
Docker : pg_dump from docker container (0) | 2018.05.15 |
ubuntu 16.04에 docker-compose 설치하기 (0) | 2018.02.07 |
ubuntu 16.04에 docker-ce (Community Edition) 설치하기 (0) | 2018.02.02 |