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 if HEALTHCHECK's retries flag is not an integer #85

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

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Jul 18, 2017

If the retries flag of a HEALTHCHECK instruction is not an integer, the engine will throw a parsing error. We should do the same and create a diagnostic for this case.

FROM scratch AS setup
HEALTHCHECK --retries=a CMD ls
$ docker  build .
Sending build context to Docker daemon  86.15MB
Step 1/2 : FROM scratch AS setup
 --->
Step 2/2 : HEALTHCHECK --retries=a CMD ls
strconv.ParseInt: parsing "a": invalid syntax
@rcjsuen
Copy link
Owner Author

rcjsuen commented Jul 19, 2017

Decimals are not allowed.

$ docker build .
Sending build context to Docker daemon  86.15MB
Step 1/2 : FROM busybox
 ---> d27c8abadd3d
Step 2/2 : HEALTHCHECK --retries=1.0 cmd ls
strconv.ParseInt: parsing "1.0": invalid syntax

Leading zeroes however are okay.

$ docker build .
Sending build context to Docker daemon  86.15MB
Step 1/2 : FROM busybox
 ---> d27c8abadd3d
Step 2/2 : HEALTHCHECK --retries=01 cmd ls
 ---> Running in 5958aa37e488
 ---> d0ce91003585
Removing intermediate container 5958aa37e488
Successfully built d0ce91003585

@rcjsuen rcjsuen self-assigned this Jul 19, 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