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

'왜 안 시작되지?' 체크리스트

~14 min · debug

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

일곱 단계 순서대로

  1. docker ps -a | grep myapp — container 존재? status 뭐?
  2. docker logs --tail 100 myapp — 죽기 전에 뭐랬어?
  3. docker inspect myapp --format '{{.State.ExitCode}}' — exit code 뭐였어?
  4. docker run -it --rm <image> sh — image 자체에서 shell 이라도 뜰까?
  5. docker exec -it myapp sh — 도는데 망가졌으면 안에 들어가.
  6. docker port myapp — 포트 진짜 매핑됐어?
  7. docker network inspect <net> — 옳은 network 에 옳은 peer 랑 있어?

Code

체크리스트 따라가기·bash
# 1
docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Image}}'

# 2
docker logs --tail 100 myapp

# 3
docker inspect myapp --format 'state={{.State.Status}} exit={{.State.ExitCode}}'

# 4 — sanity check the image itself
docker run -it --rm myapp:1.0 sh

# 5 — get inside a running but broken container
docker exec -it myapp sh

# 6
docker port myapp

# 7
docker network inspect bridge

External links

Exercise

Container 의도적으로 셋 다른 방식으로 깨: (a) 잘못된 CMD 경로, (b) 이미 쓰는 포트, (c) 시작 시 앱이 읽는 빠진 env var. 각각 7-step 체크리스트 따라가서 어느 step 이 원인 드러내는지 확인.

Progress

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

댓글 0

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

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