Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a diagnostic to warn if the durations in HEALTHCHECK's flags are too short #97

Closed
rcjsuen opened this issue Jul 21, 2017 · 1 comment
Assignees

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Jul 21, 2017

Docker doesn't allow the times in the interval, start-period, or timeout flags of HEALTHCHECK instructions to be less than one millisecond. We should create a diagnostic to check for this case.

FROM scratch
HEALTHCHECK --timeout=100ns CMD ls
$ docker build .
Sending build context to Docker daemon  86.15MB
Step 1/2 : FROM scratch
 --->
Step 2/2 : HEALTHCHECK --timeout=100ns CMD ls
Interval "timeout" cannot be less than 1ms
@rcjsuen
Copy link
Owner Author

rcjsuen commented Jul 23, 2017

Valid units of time are: "ns", "us" (or "µs"), "ms", "s", "m", and "h".

As aforementioned, the total sum must be greater than or equal to one millisecond.

FROM alpine
HEALTHCHECK --interval=1ms --start-period=1ms --timeout=1ms CMD ls
$ docker build .
Sending build context to Docker daemon  86.15MB
Step 1/2 : FROM alpine
latest: Pulling from library/alpine
88286f41530e: Pull complete
Digest: sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe
Status: Downloaded newer image for alpine:latest
 ---> 7328f6f8b418
Step 2/2 : HEALTHCHECK --interval=1ms --start-period=1ms --timeout=1ms CMD ls
 ---> Running in b380b974e4de
 ---> 4c532672bbd0
Removing intermediate container b380b974e4de
Successfully built 4c532672bbd0

@rcjsuen rcjsuen assigned rcjsuen and unassigned rcjsuen Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant