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-api

Replace 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.

Sources

댓글

이 블로그의 인기 게시물

소니 A6000 Wi-Fi 전송 (컴퓨터로 보내기)

SVN 서버 설치 및 웹 접속 설정-Ubuntu 14.04

VirtualBox(VM) 화면 크기 조절