Skip to content

Conversation

@tonistiigi
Copy link
Member

Add syntax directive for specifying the builder reference so that new dockerfile features can be targeted. New Dockerfile features can be added now without breaking backward compatibility or requiring users to upgrade. The base one would remain compatible with current moby/docker.

@tiborvass

Signed-off-by: Tonis Tiigi [email protected]

@tonistiigi tonistiigi changed the base branch from master to llbsolver-next May 14, 2018 22:40
m := map[string]string{}
s := bufio.NewScanner(r)
for s.Scan() {
match := reDirective.FindStringSubmatch(s.Text())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to handle uppercase too, so it should be strings.ToLower(s.Text()) or reDirective.FindSubmatch(bytes.ToLower(s.Bytes())) (and then cast string(m) and string(match[2]))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just change the regexp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

}

if _, ok := c.Opts()["cmdline"]; !ok {
ref, argv, ok := dockerfile2llb.DetectSyntax(bytes.NewBuffer(dtDockerfile))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I expect argv to be a vector (slice)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I just rename the var to cmdline?

@tiborvass
Copy link
Collaborator

LGTM

@AkihiroSuda
Copy link
Member

#382 needs to be merged first?

@AkihiroSuda AkihiroSuda changed the base branch from llbsolver-next to master May 17, 2018 02:16
@AkihiroSuda
Copy link
Member

AkihiroSuda commented May 17, 2018

merging into master (#382 llbsolver-next is merged now)

@AkihiroSuda AkihiroSuda merged commit 10003f2 into moby:master May 17, 2018
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 this pull request may close these issues.

3 participants