Base image, 작은 거에서 큰 거로
| Image | 크기 | 용도 |
|---|---|---|
scratch | 0 byte | Static binary (Go, Rust) |
distroless | ~20MB | 강화된 production, 최소 attack surface |
alpine | ~5-50MB | Go, Rust, 단순 Node. Python 은 까다로움 (musl). |
*-slim | ~50-150MB | 대부분 앱. 옳은 디폴트. |
full (e.g. python:3.12) | ~500MB-1GB | Dev 환경, 빌드 도구 필요할 때 |
트레이드오프 진짜야
alpine 은 musl libc 써, glibc 아니야. 많은 Python wheel 이 glibc 전용 — pip 가 alpine 에서 소스 컴파일로 fallback. 빌드 시간 10배 늘 수 있어. Go 나 Rust (static binary) 면 alpine 좋아. Python 앱이면 진짜 알고 하는 게 아닌 한 -slim 써.
distroless image 는 shell 도 package manager 도 없어. docker exec -it ... bash 못 해. production 강화엔 좋아. 즉석 디버깅엔 고통.
scratch 는 진짜 비어있음. dynamic linking 없는 static binary 만 동작. 최대 미니멀, 옳은 도구일 때만.