Docker Container Says Running but Health Is Unhealthy: Read the Probe Output
Read .State.Health with docker inspect. Docker's running state describes the container process. Health status comes from the configured probe and can fail even while the process remains up.
Inspect the health record and configured probe
docker inspect --format '{{json .State.Health}}' demo-api
docker inspect --format '{{json .Config.Healthcheck}}' demo-apiReplace the synthetic name with a development container you operate. Look at the newest reported exit code and output. Some health output can contain environment-specific details, so review it before sharing. If the health record is absent, check whether the container image or runtime configuration actually has a health check.
Separate a bad probe from a slow service
A synthetic probe exits with a shell message that its HTTP client executable is missing. That result points to the command in the image. A different example has a valid probe but repeatedly receives connection refused during planned warm-up. Check the actual host, internal port, health route and supported startup grace period together.
Confirm recovery over several check intervals
Use the normal build and deployment workflow for a corrected image or configuration, then check that health stays healthy for multiple probe intervals. Also make one normal application request within the test environment. If the application request succeeds while the probe still fails, compare what the probe checks with the service's intended health contract.
댓글
댓글 쓰기
안녕하세요 :)