Challenge - 5 Problems
Container Health Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of the health check status command?
You have a Docker container running with a health check configured. You run the command
docker inspect --format='{{.State.Health.Status}}' mycontainer. What output do you expect if the container is healthy?Attempts:
2 left
💡 Hint
Think about the possible health states Docker reports.
✗ Incorrect
The .State.Health.Status field shows the current health status of the container. If the container passes all health checks, it reports healthy.
🧠 Conceptual
intermediate1:30remaining
Which Dockerfile instruction defines a health check?
In a Dockerfile, which instruction is used to define a container health check?
Attempts:
2 left
💡 Hint
It is a single word instruction starting with HEALTH.
✗ Incorrect
The HEALTHCHECK instruction in a Dockerfile defines how Docker tests the container's health.
❓ Configuration
advanced2:00remaining
Identify the correct health check configuration in Dockerfile
Which of the following Dockerfile snippets correctly configures a health check that runs
curl -f http://localhost/ || exit 1 every 30 seconds with a timeout of 10 seconds?Attempts:
2 left
💡 Hint
Options flags come immediately after HEALTHCHECK, before CMD.
✗ Incorrect
The correct syntax places options like --interval and --timeout right after HEALTHCHECK and before CMD. The command follows CMD.
❓ Troubleshoot
advanced2:00remaining
Why does the health check always show 'starting' status?
You configured a health check in your Docker container, but
docker inspect always shows the status as starting. What is the most likely cause?Attempts:
2 left
💡 Hint
Think about what 'starting' means in health check lifecycle.
✗ Incorrect
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.
✅ Best Practice
expert2:30remaining
What is the best practice for health check command exit codes?
For Docker container health checks, which exit code convention should the health check command follow to indicate a healthy or unhealthy state?
Attempts:
2 left
💡 Hint
Think about standard Unix command exit codes.
✗ Incorrect
By Unix convention, exit code 0 means success (healthy), and any non-zero exit code means failure (unhealthy). Docker health checks follow this.