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

Support parsing of digest provided with an optional empty tag #113

Closed
rcjsuen opened this issue Sep 10, 2023 · 0 comments
Closed

Support parsing of digest provided with an optional empty tag #113

rcjsuen opened this issue Sep 10, 2023 · 0 comments
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Sep 10, 2023

FROM node:@sha256:613685c22f65d01f2264bdd49b8a336488e14faf29f3ff9b6bf76a4da23c4700

This Dockerfile cannot be built but the tag has been declared (as the empty string) so we should return it. Instead we are returning null. Looks like this case was missed while implementing #112.

const lib = require("dockerfile-ast");
const content = "FROM node:@sha256:613685c22f65d01f2264bdd49b8a336488e14faf29f3ff9b6bf76a4da23c4700";
const instruction = lib.DockerfileParser.parse(content).getInstructions()[0];
console.log(instruction.getImageTag());
console.log(instruction.getImageTagRange());
null
null
@rcjsuen rcjsuen added the bug label Sep 10, 2023
@rcjsuen rcjsuen self-assigned this Sep 10, 2023
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