{"action":"created","issue":{"url":"https://api.github.com/repos/moby/moby/issues/33410","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/33410/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/33410/comments","events_url":"https://api.github.com/repos/moby/moby/issues/33410/events","html_url":"https://github.com/moby/moby/issues/33410","id":231726470,"number":33410,"title":"Perform first healthcheck on startup without waiting the specified interval","user":{"login":"alexpirine","id":1610035,"avatar_url":"https://avatars1.githubusercontent.com/u/1610035?v=4","gravatar_id":"","url":"https://api.github.com/users/alexpirine","html_url":"https://github.com/alexpirine","followers_url":"https://api.github.com/users/alexpirine/followers","following_url":"https://api.github.com/users/alexpirine/following{/other_user}","gists_url":"https://api.github.com/users/alexpirine/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpirine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpirine/subscriptions","organizations_url":"https://api.github.com/users/alexpirine/orgs","repos_url":"https://api.github.com/users/alexpirine/repos","events_url":"https://api.github.com/users/alexpirine/events{/privacy}","received_events_url":"https://api.github.com/users/alexpirine/received_events","type":"User","site_admin":false},"labels":[{"id":73641990,"url":"https://api.github.com/repos/moby/moby/labels/area/runtime","name":"area/runtime","color":"fbca04","default":false},{"id":179237356,"url":"https://api.github.com/repos/moby/moby/labels/kind/enhancement","name":"kind/enhancement","color":"E8CAAF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-05-26T20:23:28Z","updated_at":"2018-03-22T10:26:09Z","closed_at":null,"author_association":"NONE","body":"This is a feature request.\r\n\r\nCurrently, health checks work and are great to ensure continuous, uninterrupted service, even when rolling updates.\r\n\r\nHowever, I might want to specify a rather long health check interval, let's say 5 minutes, because my health check checks for a few different things and is a bit time- and resource-consuming.\r\n\r\nThe [documentation](https://docs.docker.com/engine/reference/builder/#healthcheck) states:\r\n\r\n> The health check will first run interval seconds after the container is started, and then again interval seconds after each previous check completes.\r\n\r\nThis doesn't work well with continuous delivery, since I'll have to wait 5 minutes before the first container with my new software version is available. This is a long time to wait. And I don't really want to end up with containers running different versions of software for a long period time.\r\n\r\nWhy couldn't we just run the first health check right after startup, without waiting for `interval` delay?"},"comment":{"url":"https://api.github.com/repos/moby/moby/issues/comments/375248795","html_url":"https://github.com/moby/moby/issues/33410#issuecomment-375248795","issue_url":"https://api.github.com/repos/moby/moby/issues/33410","id":375248795,"user":{"login":"dtakken","id":2066447,"avatar_url":"https://avatars2.githubusercontent.com/u/2066447?v=4","gravatar_id":"","url":"https://api.github.com/users/dtakken","html_url":"https://github.com/dtakken","followers_url":"https://api.github.com/users/dtakken/followers","following_url":"https://api.github.com/users/dtakken/following{/other_user}","gists_url":"https://api.github.com/users/dtakken/gists{/gist_id}","starred_url":"https://api.github.com/users/dtakken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtakken/subscriptions","organizations_url":"https://api.github.com/users/dtakken/orgs","repos_url":"https://api.github.com/users/dtakken/repos","events_url":"https://api.github.com/users/dtakken/events{/privacy}","received_events_url":"https://api.github.com/users/dtakken/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T10:26:09Z","updated_at":"2018-03-22T10:26:09Z","author_association":"NONE","body":"The simplest solution would be to change Docker behavior and perform a health check just after **--start-period** seconds.\r\n\r\nIn case there are concerns about breaking existing setups, a new option would need to be introduced. Something like **--check-on-start** could trigger an additional check just when the container is expected to have started, after **--start-period** seconds. \r\n\r\nSince **--start-period** is zero by default, enabling **--check-on-start** would do a first health check immediately, which makes sense for most containers. For containers that need a second to start, setting **--start-period=2** for instance would do a health check after two seconds.\r\n\r\n@thaJeztah: Which of these two options would be acceptable?"}}
{"actor":{"display_login":"dtakken"}}