-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Docker image name incorrectly identified as registry in FROM #59
Comments
@daimor This opens up an interesting can of worms as you could have any arbitrary word in front of the image's name and have that be a Docker registry given your local DNS settings or whatever. I wonder how Docker implements this on their end. Could they be hardcoding the word |
Well, I found this code, which used by docker-cli // splitDockerDomain splits a repository name to domain and remotename string.
// If no valid domain is found, the default domain is used. Repository name
// needs to be already validated before.
func splitDockerDomain(name string) (domain, remainder string) {
i := strings.IndexRune(name, '/')
if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != "localhost") {
domain, remainder = defaultDomain, name
} else {
domain, remainder = name[:i], name[i+1:]
}
if domain == legacyDefaultDomain {
domain = defaultDomain
}
if domain == defaultDomain && !strings.ContainsRune(remainder, '/') {
remainder = officialRepoName + "/" + remainder
}
return
} So, it actually means, that |
@daimor Well then. You learn something new every day as I always like to say... Thanks for digging this up! |
import { DockerfileParser, From } from './main';
const dockerfile = DockerfileParser.parse("FROM store/base/image");
const from = (dockerfile.getInstructions()[0]) as From;
console.log(from.getImageName());
We should get |
Docker images that did not include a hostname were incorrectly being flagged as having one. Signed-off-by: Remy Suen <remy.suen@gmail.com>
@daimor Thanks for the bug report. Have a great weekend! |
Docker hub has images from verified publishers, and such image names starts with
store/
For example
store/intersystems/iris-community
linkstore/intersystems/irishealth
linkstore/splunk/universalforwarder
linkon so on
At the moment parser recognizes
store
as registry but in this case it is just a part of image nameTo be solved for microsoft/vscode-docker#1337
The text was updated successfully, but these errors were encountered: