Which of the following best describes the purpose of a HEALTHCHECK instruction in a Dockerfile?
Think about how Docker knows if a container is healthy or not.
The HEALTHCHECK instruction tells Docker how to test the container's health by running a command inside it periodically.
What is the output of the following command if the container named webapp is healthy?
docker inspect --format='{{.State.Health.Status}}' webappThe command shows the health status of the container.
The command prints the health status of the container. If the container is healthy, it outputs healthy.
You want to receive an alert when a Docker container becomes unhealthy. Which workflow below correctly describes the steps to achieve this using Docker events and a simple script?
Think about how to get real-time notifications from Docker.
Docker events can be used to listen for health status changes. Filtering for 'unhealthy' events allows triggering alerts automatically.
A container's health check keeps failing even though the service inside is running fine. Which of the following is the most likely cause?
Consider what the health check command does and how Docker interprets its result.
If the health check command is wrong or returns a non-zero exit code, Docker marks the container as unhealthy even if the service is running.
Which health check command is the best choice to monitor a web server running inside a Docker container?
Think about a command that verifies the web server is responding correctly.
Using curl -f checks if the web server responds with a successful HTTP status. Other options do not verify the web service properly.