diff --git a/builder/command/command.go b/builder/command/command.go index dd24ee44c5..16544f0267 100644 --- a/builder/command/command.go +++ b/builder/command/command.go @@ -22,6 +22,7 @@ const ( // Commands is list of all Dockerfile commands var Commands = map[string]struct{}{ Env: {}, + Label: {}, Maintainer: {}, Add: {}, Copy: {}, diff --git a/builder/dispatchers.go b/builder/dispatchers.go index 965fd68c03..3cb3a9fb3a 100644 --- a/builder/dispatchers.go +++ b/builder/dispatchers.go @@ -91,7 +91,7 @@ func maintainer(b *Builder, args []string, attributes map[string]bool, original // func label(b *Builder, args []string, attributes map[string]bool, original string) error { if len(args) == 0 { - return fmt.Errorf("LABEL is missing arguments") + return fmt.Errorf("LABEL requires at least one argument") } if len(args)%2 != 0 { // should never get here, but just in case diff --git a/builder/evaluator.go b/builder/evaluator.go index aee60426c1..9808a3c42d 100644 --- a/builder/evaluator.go +++ b/builder/evaluator.go @@ -49,6 +49,7 @@ var ( // Environment variable interpolation will happen on these statements only. var replaceEnvAllowed = map[string]struct{}{ command.Env: {}, + command.Label: {}, command.Add: {}, command.Copy: {}, command.Workdir: {}, diff --git a/builder/parser/line_parsers.go b/builder/parser/line_parsers.go index 06115e831a..45c929ee69 100644 --- a/builder/parser/line_parsers.go +++ b/builder/parser/line_parsers.go @@ -137,7 +137,7 @@ func parseNameVal(rest string, key string) (*Node, map[string]bool, error) { } if len(words) == 0 { - return nil, nil, fmt.Errorf(key + " requires at least one argument") + return nil, nil, nil } // Old format (KEY name value)