728x90
반응형
1. docker inspect container_id
명령어를 치면 굉장히 많은 정보를 확인할 수 있다. 그래서 grep 으로 조회하면 좀 수월하다.
docker inspect container_id | grep IP
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "192.168.0.1",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"IPAMConfig": null,
"IPAddress": "192.168.0.1",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
2. docker exec -it container_id /bin/bash
위 명령어를 사용하면 컨테이너 내부로 접속이 가능하다. 내부로 접속을 해서 ip addr 이나 ifconfig, hostname -I 등을 사용해서 확인 가능하다.
3. docker exec container_id command
exec 만 사용을 하고 후에 명령어를 치면 컨테이너 내부에 명령어를 보내 실행이 가능하다.
728x90
반응형
'Development > Docker&Kubernetes' 카테고리의 다른 글
[k8s] Network Policy namespaceSelector (0) | 2022.03.28 |
---|---|
[Docker] 컨테이너와 외부 디렉토리 연결하기 (0) | 2021.11.16 |
[Docker] history 명령어 (0) | 2021.11.12 |
[k8s] drain 명령어 (0) | 2021.11.04 |
taint, cordon 의 차이점은? (0) | 2021.11.04 |