-
Notifications
You must be signed in to change notification settings - Fork 1.3k
dockerfile: add syntax directive for introducing new features #384
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
Conversation
4d9ba59 to
d4d57dd
Compare
| m := map[string]string{} | ||
| s := bufio.NewScanner(r) | ||
| for s.Scan() { | ||
| match := reDirective.FindStringSubmatch(s.Text()) |
There was a problem hiding this comment.
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]))
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
d4d57dd to
a6ea1c3
Compare
frontend/dockerfile/builder/build.go
Outdated
| } | ||
|
|
||
| if _, ok := c.Opts()["cmdline"]; !ok { | ||
| ref, argv, ok := dockerfile2llb.DetectSyntax(bytes.NewBuffer(dtDockerfile)) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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?
Signed-off-by: Tonis Tiigi <[email protected]>
a6ea1c3 to
460fb33
Compare
|
LGTM |
|
#382 needs to be merged first? |
|
merging into master (#382 llbsolver-next is merged now) |
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]