Interview Prep/Docker/Image design and Dockerfile decisions

Which `HEALTHCHECK` command do you use in a distroless image with no `curl`?

IntermediateScenarioImage design and Dockerfile decisions
Answer

Situation read → No shell and no curl means a Dockerfile HEALTHCHECK CMD curl fails.

What I'd do → Add a tiny health subcommand to the app binary (/app healthcheck) and use exec form:

HEALTHCHECK --interval=15s --timeout=3s --start-period=20s --retries=3 \
  CMD ["/app", "healthcheck"]

Alternatively rely on orchestrator probes (Kubernetes HTTP probes) instead of Docker's.

Why → Keeps the image minimal while retaining health semantics.

Interview tip → In Kubernetes, the Dockerfile HEALTHCHECK is ignored; use probes.

All Docker questions Roadmap: Docker & containers

More on Image design and Dockerfile decisions