-
Notifications
You must be signed in to change notification settings - Fork 424
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
Error when using host:port in a FROM instruction #355
Error when using host:port in a FROM instruction #355
Comments
Noticing the same in one of our cases too with Nexus registries. Since this is an open issue, I am assuming there is not a fix in the latest versions. Can I add an ignore on this by any means ? Thank you |
There is no workaround, unfortunately, it is a deficiency in the parser. I'll include this fix for next version |
Thanks @lorenzo . |
In addition, I have a multi-stage Dockerfile containing:
... which also generates the same error, for character 36 ( Version |
when having a FROM line like: `FROM myregistry:port/imagename:tag`, there is an error `unexpected ':' expecting '@', a new line followed by the next instruction, at least one space, or the image tag`. This patch proposes to simplify how the registry is computed. fixes: hadolint/hadolint#355 I don't know haskell, I tested the change by cloning the repo, and testing on a local file using the test in integration-tests
Expected behavior
The linter should run on Dockerfiles that use a custom registry with the following format host:port.
Actual behavior
Returns an error before running any linting checks:
unexpected ':' expecting '@', a new line followed by the next instruction, at least one space, or the image tag
.Steps to reproduce the behavior
Create the following Dockerfile:
FROM myregistry:443/imagename:tag
Run
docker run --rm -i hadolint/hadolint < Dockerfile
.The error will be triggered.
If you add a
.anything
aftermyregistry
or if you remove:443
it will work.Output of
hadolint --version
ordocker run --rm hadolint/hadolint hadolint --version
:Dockerfile (if relevant)
FROM myregistry:443/imagename:tag
We are using an Artifactory repository on a local network, that's why we have a
host:port
registry.The text was updated successfully, but these errors were encountered: