Compose: Unsupported config option 'healthcheck' with version 2.1 syntax

Created on 7 Feb 2017  ·  3Comments  ·  Source: docker/compose

Using the following docker-compose.yml:

version: '2.1'
services:
  db:
    image: "<my_image>"
    healthcheck:
      disable: true

I get the following error when running docker-compose up :

$ docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.db: 'healthcheck'

According to the documentation, "healthcheck" should be supported with the currently installed versions:

$ docker --version
Docker version 1.13.0, build 49bf474
$ docker-compose --version
docker-compose version 1.9.0, build 2585387
kinquestion

Most helpful comment

The documentation didn't make it clear: it just specifies that Compose 1.6.0 is required for version 2.0 of the docker-compose.yml specification. Maybe a documentation update would help other people as well :-)

All 3 comments

Hi,

you have to upgrade to Compose 1.10.1 - 1.9 doesn't have healthcheck support.

The documentation didn't make it clear: it just specifies that Compose 1.6.0 is required for version 2.0 of the docker-compose.yml specification. Maybe a documentation update would help other people as well :-)

You can also see this error if healthchecks are defined in your yaml file but the 'version' value in the file is '2' (for example) even if you are running a docker compose version that supports them. Change the version in the file to the correct version (such as 2.3) may be the only needed remedy in that case.

Was this page helpful?
0 / 5 - 0 ratings