Giter Club home page Giter Club logo

healthcheck's People

Contributors

gerhard avatar grooverdan avatar pierre-guillot-gh avatar teohhanhui avatar tianon avatar tobias-trabelsi-sonarsource avatar yosifkit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

healthcheck's Issues

Official?

Maybe this isn't the proper place to ask, but is there any particular reason the prototyping that has occurred within these images haven't made its way into the official images? HEALTHCHECK is an advertised feature of Dockerfiles and it feels that official images should show the way forward and demonstrate how to check upon themselves.

Healthcheck fail when container has multiple networks

When container is in multiple networks, most of the healthchecks fail.
The reason is that commands like

host="$(hostname -i || echo '127.0.0.1')"

(from postgres, redis), and

host="$(hostname --ip-address || echo '127.0.0.1')"

(from elasticsearch)

use hostname -i which in case of multiple networks return multiple ips.
i.e.

[root@ccaa85c77ed1 elasticsearch]# hostname --ip-address
192.168.208.3 192.168.176.2

so $host becomes invalid.

Healthcheck script execution permissions in alpine

Healthcheck scripts didn't work (timeout and service unhealthy in docker ps) in alpine images of rabbitmq and postgres, until i added the following command in Dockerfile:
RUN chmod +x /usr/local/bin/docker-healthcheck

Docker CE v17.03.0-ce-mac2 (15654)

Are these compatible with swarm mode?

Hello all!

Thanks for sharing this. I've tried your healtcheck method with postgres using https://hub.docker.com/r/mdillon/postgis/~/dockerfile/ as the base image and everything works as expected when in non-swarm mode. Whenever I try to the same image in swarm mode, it never stays in running mode. Is it incompatible? It looks like it is ready to run, but, after a while, there is a shutdown request, as seen in the logs:

test-swarm_db.1.w83nr7m4m3wq@test-docker-swarm-test2-manager    | LOG:  received smart shutdown request
test-swarm_db.1.w83nr7m4m3wq@test-docker-swarm-test2-manager    | LOG:  autovacuum launcher shutting down
test-swarm_db.1.w83nr7m4m3wq@test-docker-swarm-test2-manager    | LOG:  shutting down
test-swarm_db.1.w83nr7m4m3wq@test-docker-swarm-test2-manager    | LOG:  database system is shut down
test-swarm_db.1.juy14y8pi8xu@test-docker-swarm-test2-manager    | LOG:  database system was shut down at 2017-03-21 16:43:58 UTC

Thank you all in advance!

EDIT: Nvm, it looks like everything is ok - I just add a versioning problem....

Redis healthcheck

Healthcheck command fails if redis.conf is provided. I ran this manually and I get this error:

Could not connect to Redis at 172.17.0.2:6379: Connection refused

My assumption is either localhost or 127.0.0.1 should stay, instead of fetching the host ip

Here is my Dockerfile

image

Alpine images

Thanks for all the work you're doing @tianon ๐Ÿ‘
Would love to see alpine images with health check :) postgres:latest is 100mb+ while postgres:alpine is 14mb

mysqladmin

Hi,
you can try using mysqladmin to check whether the MySQL server is alive. I do the following in a project for blocking the docker start sequence until the server has been initialized. What happens is that a COM_PING packet is sent over the wire to the server. Here is some documentation about the COM_PING packet:
https://dev.mysql.com/doc/internals/en/com-ping.html

                while [[ `mysqladmin ping -uroot -p$$MYSQL_ROOT_PASSWORD 2>/dev/null` != "mysqld is alive" ]] ; \
                        do echo Waiting MySQL Server to start...; sleep 1; \
                done ; \

A SELECT query will increase a statistical variable about the queries. If someone is using it this will skew the results.

More version tags

It would be nice to be able to use specific version of postgres:

for instance:

postgres:
image: healthcheck/postgres:9.5

Change interval

Hi!

I am using the healthcheck/mysql. The interval for healthcheck seems to be set to 30s by default from my observation. I am wondering is there a way to change the interval?

Thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.