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

Hadolint fails in the FROM when specifying a port number for a registry #169

Closed
1 of 3 tasks
Rickkwa opened this issue Feb 27, 2018 · 2 comments · Fixed by #174
Closed
1 of 3 tasks

Hadolint fails in the FROM when specifying a port number for a registry #169

Rickkwa opened this issue Feb 27, 2018 · 2 comments · Fixed by #174

Comments

@Rickkwa
Copy link

Rickkwa commented Feb 27, 2018

  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

The linter should run on Dockerfiles that use a custom registry with a port number.

Actual behavior

The linter errors out before running any linting checks.

Steps to reproduce the behavior

Create the following Dockerfile:

FROM myregistry.com:5000/imagename:tag

Run docker run --rm -i hadolint/hadolint < Dockerfile.

You will see an error like:

/dev/stdin:1:35 unexpected ':' expecting spaces, "AS" or a new line followed by the next instruction

If you remove the :5000, the error goes away.

Output of hadolint --version or
docker run --rm hadolint/hadolint hadolint --version:

# docker run --rm hadolint/hadolint hadolint --version
Haskell Dockerfile Linter v1.5.0-9-g508b1cf

Dockerfile (if relevant)

FROM myregistry.com:5000/imagename:tag

Additional environment details (OS, stack version, etc.)

$ docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:25 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:25 2017
 OS/Arch:      linux/amd64
 Experimental: false
@Rickkwa
Copy link
Author

Rickkwa commented Feb 27, 2018

This is an issue of having 2 colons.

@zemanlx
Copy link
Member

zemanlx commented Feb 28, 2018

Good catch @Rickkwa!

Note to ourself

What else we can expect in pattern registry/imagename:label

  • localhost:5000/debian:9
  • 172.30.25.243:5000/lgx-project/ruby-ex:3

in image tag area we can expect that there won't be a colon docker_registry/tags.py#L25
and I have also found a word description of naming at https://docs.docker.com/engine/reference/commandline/tag/#extended-description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants