반응형

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
반응형

+ Recent posts