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

FROM instructions do not get parsed correctly if they refer to a private registry #28

Closed
rcjsuen opened this issue May 19, 2018 · 1 comment
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented May 19, 2018

We need to take into consideration the presence of multiple semi-colons in a FROM's first argument.

import { DockerfileParser } from 'dockerfile-ast';
import { TextDocument } from 'vscode-languageserver-types/lib/umd/main';

const content =
`FROM privateregistry.com:5000/image:tag
FROM localhost:1234/node:9
FROM 123.22.33.123:2345/user/image:tag2`;

let dockerfile = DockerfileParser.parse(content);
let froms = dockerfile.getFROMs();
let document = TextDocument.create("", "", 1, content);

console.log(froms[0].getImageName());
console.log(froms[1].getImageName());
console.log(froms[2].getImageName());
privateregistry.com:5000/image
localhost:1234/node
123.22.33.123:2345/user/image
@rcjsuen rcjsuen added the bug label May 19, 2018
@rcjsuen
Copy link
Owner Author

rcjsuen commented May 22, 2018

Private registries do not require a port to be specified. This makes it difficult to identify things like localhost/node as it is not possible to know that localhost is a URL and not part of the image's name...

@rcjsuen rcjsuen self-assigned this May 22, 2018
rcjsuen added a commit that referenced this issue May 24, 2018
The simple case of user/image was broken by the fix for #28 in
3c7215c. Tests have been added to
ensure that this regression does not happen again in the future.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant