How can I use HEALTHCHECK in docker-compose?

docker

#1

Hi, I am trying to configure my build to support HEALTHCHECK instruction in docker-compose.

I tried to rebuild with ssh and login to the server and check all the versions. Everything seems to be fine. Except it doesn’t work. So reported docker version is:

$ docker version
Client:
 Version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   60ccb22
 Built:        Thu Feb 23 10:57:47 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   60ccb22
 Built:        Thu Feb 23 10:57:47 2017
 OS/Arch:      linux/amd64
 Experimental: false
$ docker-compose version
docker-compose version 1.9.0, build 2585387
docker-py version: 1.10.6
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1t  3 May 2016

That all tells me that HEALTHCHECK should be supported. So my circle ci config has machine: true instruction and then I am running: docker-compose run --rm codeception run --html --xml -vvv which fails with an error:

ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.chrome: 'healthcheck'
Unsupported config option for services.mysql: 'healthcheck'
services.wordpress.depends_on contains an invalid type, it should be an array

The first line in my docker-compose.yml is: version: '2.1'

So is there something I am missing? Why is the healthcheck instruction failing?


#2

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.