nerdexam
Docker

DCA · Question #43

The following health check exists in a Dockerfile: Which of the following describes its purpose?

The correct answer is A. Defines the action taken when container health fails, which in this case will kill the container with. The Dockerfile HEALTHCHECK instruction defines a mechanism for Docker to monitor a container's health, enabling orchestration systems to take remedial actions when the health check fails.

Submitted by hans_de· Apr 18, 2026Container Orchestration

Question

The following health check exists in a Dockerfile:

Which of the following describes its purpose?

Options

  • ADefines the action taken when container health fails, which in this case will kill the container with
  • BDefines the health check endpoint on the localhost interface for external monitoring tools to
  • CDefines the health check endpoint on the local host interface for containers to monitor the health of
  • DDefines the health check for the containerized application so that the application health can be

How the community answered

(33 responses)
  • A
    94% (31)
  • C
    3% (1)
  • D
    3% (1)

Why each option

The Dockerfile HEALTHCHECK instruction defines a mechanism for Docker to monitor a container's health, enabling orchestration systems to take remedial actions when the health check fails.

ADefines the action taken when container health fails, which in this case will kill the container withCorrect

The `HEALTHCHECK` instruction in a Dockerfile specifies a command to determine if the application inside the container is functioning correctly. When this health check consistently fails, Docker updates the container's health status to 'unhealthy', which then enables orchestration platforms (like Docker Swarm or Kubernetes) to automatically take remedial actions such as stopping (killing) the unhealthy container and potentially replacing it.

BDefines the health check endpoint on the localhost interface for external monitoring tools to

The `HEALTHCHECK` command runs *inside* the container to check its internal state; it does not expose an external endpoint on the host for monitoring tools.

CDefines the health check endpoint on the local host interface for containers to monitor the health of

Similar to B, the instruction checks internal health within the container, not providing an endpoint on the host for other containers.

DDefines the health check for the containerized application so that the application health can be

While it defines a health check, this statement is too general and doesn't capture the crucial aspect of what happens or is enabled when the health check fails, which is implied by the correct answer.

Concept tested: Dockerfile HEALTHCHECK instruction purpose

Source: https://docs.docker.com/engine/reference/builder/#healthcheck

Topics

#HEALTHCHECK#Dockerfile#Container Health#Container Lifecycle

Community Discussion

No community discussion yet for this question.

Full DCA Practice