diff --git a/builder/parser/parser.go b/builder/parser/parser.go index b8685767b9..69bbfd0dc1 100644 --- a/builder/parser/parser.go +++ b/builder/parser/parser.go @@ -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, } }