Skip to content

Docker Compose healthcheck example suggests incorrect usage of healthcheck feature #23077

@jennydaman

Description

@jennydaman

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

The documentation says:

For more information on HEALTHCHECK, see the Dockerfile reference.

The Dockerfile reference says:

The command's exit status indicates the health status of the container. The possible values are:

  • 0: success - the container is healthy and ready for use
  • 1: unhealthy - the container isn't working correctly
  • 2: reserved - don't use this exit code

However, the Docker Compose documentation gives this example:

test: ["CMD", "curl", "-f", "http://localhost"]

curl usually produces an exit status other than 1 for errors.

Location

https://docs.docker.com/reference/compose-file/services/#healthcheck

Suggestion

No response

Metadata

Metadata

Labels

area/buildRelates to Dockerfiles or docker build commandarea/composeRelates to docker-compose.yml spec or docker-compose binarykind/bugBugs. The Cause may not be known at triage time. Consider debugging time for estimatesstatus/triageNeeds triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions