mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
builder/parser: Make use of builder/command
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
parent
ccde3a1f73
commit
72a070c5da
1 changed files with 16 additions and 14 deletions
|
@ -7,6 +7,8 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/docker/docker/builder/command"
|
||||
)
|
||||
|
||||
// Node is a structure used to represent a parse tree.
|
||||
|
@ -44,20 +46,20 @@ func init() {
|
|||
// functions. Errors are propagated up by Parse() and the resulting AST can
|
||||
// be incorporated directly into the existing AST as a next.
|
||||
dispatch = map[string]func(string) (*Node, map[string]bool, error){
|
||||
"user": parseString,
|
||||
"onbuild": parseSubCommand,
|
||||
"workdir": parseString,
|
||||
"env": parseEnv,
|
||||
"maintainer": parseString,
|
||||
"from": parseString,
|
||||
"add": parseMaybeJSONToList,
|
||||
"copy": parseMaybeJSONToList,
|
||||
"run": parseMaybeJSON,
|
||||
"cmd": parseMaybeJSON,
|
||||
"entrypoint": parseMaybeJSON,
|
||||
"expose": parseStringsWhitespaceDelimited,
|
||||
"volume": parseMaybeJSONToList,
|
||||
"insert": parseIgnore,
|
||||
command.User: parseString,
|
||||
command.Onbuild: parseSubCommand,
|
||||
command.Workdir: parseString,
|
||||
command.Env: parseEnv,
|
||||
command.Maintainer: parseString,
|
||||
command.From: parseString,
|
||||
command.Add: parseMaybeJSONToList,
|
||||
command.Copy: parseMaybeJSONToList,
|
||||
command.Run: parseMaybeJSON,
|
||||
command.Cmd: parseMaybeJSON,
|
||||
command.Entrypoint: parseMaybeJSON,
|
||||
command.Expose: parseStringsWhitespaceDelimited,
|
||||
command.Volume: parseMaybeJSONToList,
|
||||
command.Insert: parseIgnore,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue