docker inspect --format='{{.State.Health.Status}}' mycontainer. What output do you expect if the container is healthy?The .State.Health.Status field shows the current health status of the container. If the container passes all health checks, it reports healthy.
The HEALTHCHECK instruction in a Dockerfile defines how Docker tests the container's health.
curl -f http://localhost/ || exit 1 every 30 seconds with a timeout of 10 seconds?The correct syntax places options like --interval and --timeout right after HEALTHCHECK and before CMD. The command follows CMD.
docker inspect always shows the status as starting. What is the most likely cause?If the health check command never finishes or exceeds the timeout, Docker keeps the status at starting because it never gets a success or failure result.
By Unix convention, exit code 0 means success (healthy), and any non-zero exit code means failure (unhealthy). Docker health checks follow this.
