C.W.K.
Stream
Lesson 03 of 03 · published

Network 디버깅 — netshoot, dig, curl, nslookup

~14 min · debug, networking

Level 0Container 호기심
0 XP0/36 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Container 가 DB 에 도달 못 해 — 이제 어쩌지?

서비스 간 network 문제는 두 번째로 흔한 디버깅 카테고리. 진단 도구를 앱 image 에 깔지 마. 전용 디버그 image 써 — nicolaka/netshoot 가 정석. curl, dig, nslookup, tcpdump, mtr 다 들어있어.

Code

안에서 network probe·bash
# Drop a debug container onto the same network as the broken service
docker run --rm -it --network app-net nicolaka/netshoot

# Inside:
nslookup api          # does DNS resolve?
curl -v http://api:8000/health   # does HTTP work?
ping -c 2 db          # are we even on the same network?
tcpdump -i any 'port 5432'  # what's actually crossing the wire?

External links

Exercise

멀티 container compose stack 진단을 netshoot 로: 같은 network 의 netshoot container 에서 (a) DNS 가 모든 서비스 이름 해석, (b) 포트 도달, (c) curl -v 가 예상 응답 — 확인. 가장 유용한 명령 4개 캡처.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.