일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- macos
- HLS
- wireshark
- VSCode
- spring cloud config
- Kubernetes
- aws
- dart
- Flutter
- android studio
- Sysinternals
- Java
- namespace
- kubectl
- service
- configmap
- 행정구역분류
- golang
- Shell script
- docker
- ffmpeg
- Android
- Python
- RTMP
- nginx-media-server
- ebpf
- deployment
- Windows10
- Pod
- aws cli
Archives
- Today
- Total
woonizzooni
Docker Container IP 확인, 네트워크 정보 조회 본문
- 특정 Container의 IP를 찾고 싶다면,
1) docker inspect '컨테이너이름' -f "{{json .NetworkSettings.Networks }}"
2) 컨테이너에 ip명령으로 정보조회
1)
docker inspect mysonarqube -f "{{json .NetworkSettings.Networks }}"
{
"bridge":{
"IPAMConfig":null,
"Links":null,
"Aliases":null,
"NetworkID":"799f0**",
"EndpointID":"**0af086eb68e",
"Gateway":"172.17.0.1",
"IPAddress":"172.17.0.6",
"IPPrefixLen":16,"IPv6Gateway":"",
"GlobalIPv6Address":"",
"GlobalIPv6PrefixLen":0,
"MacAddress":"02:42:ac:11:00:06",
"DriverOpts":null
}
}
2)
docker exec mysonarqube ip addr show | grep inet
inet 127.0.0.1/8 scope host lo
inet 172.17.0.6/16 brd 172.17.255.255 scope global eth0
docker exec mysonarqube ip addr show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
docker exec mysonarqube ip addr show eth0
15: eth0@if16: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:06 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.6/16 brd 172.17.255.255 scope global eth0
valid_lft forever preferred_lft forever
- Container다수의 정보를 찾고 싶다면 네트워크별 컨테이너의 IP를 찾자 (이게 가장 편한 듯)
1) Docker network ls
2) Docker network inpect '네트워크이름' -f "{{ json. .Containers }}"
1) docker network ls명령으로 네트워크 찾기
docker network ls
NETWORK ID NAME DRIVER SCOPE
799f023c8549 bridge bridge local
d410cf433cde host host local
f1515170d9e7 none null local
2) Docker network inspect "네트워크 이름"을 사용하는 모든 컨테이너의 IP 찾기
docker network inspect { bridege | host | none | ..... } -f "{{ json .Containers }}"
docker network inspect bridge -f "{{ json .Containers }}" | jq
{
"10974a**":{
"Name":"pgadmin4",
"EndpointID":"**ee4526ea",
"MacAddress":"02:42:ac:11:00:07",
"IPv4Address":"172.17.0.7/16",
"IPv6Address":""
},
"1e77d1b**":{
"Name":"mynexus",
"EndpointID":"**5bfc52871",
"MacAddress":"02:42:ac:11:00:04",
"IPv4Address":"172.17.0.4/16",
"IPv6Address":""
},
"3e739395**":{
"Name":"mypostgres",
"EndpointID":"**dba06c4412",
"MacAddress":"02:42:ac:11:00:05",
"IPv4Address":"172.17.0.5/16",
"IPv6Address":""
},
"42968c40b9**":{
"Name":"mysqldb",
"EndpointID":"3**ef3598bad",
"MacAddress":"02:42:ac:11:00:02",
"IPv4Address":"172.17.0.2/16",
"IPv6Address":""
},
"7f9dabdc9096**":{
"Name":"myjenkins","
EndpointID":"**be1cd55f0c",
"MacAddress":"02:42:ac:11:00:03",
"IPv4Address":"172.17.0.3/16",
"IPv6Address":""
},
"8a22fc716fd**":{
"Name":"mysonarqube",
"EndpointID":"**abbe0af086eb68e",
"MacAddress":"02:42:ac:11:00:06",
"IPv4Address":"172.17.0.6/16",
"IPv6Address":""
}
}
'Docker' 카테고리의 다른 글
Docker - NGINX MEDIA SERVER 만들기 (0) | 2020.11.08 |
---|---|
Docker 주요 명령어 (0) | 2019.06.30 |
Docker PostgreSQL, pgAdmin4, SonarQube설치 및 연동 (0) | 2019.06.19 |
Docker Toolbox 설치, 메모리 확장, 디스크 확장, timezone변경 (2) | 2019.06.18 |
Docker Sonatype Nexus 설치 (0) | 2019.06.18 |
Comments