diff --git a/builder/dockerfile/dispatchers.go b/builder/dockerfile/dispatchers.go index 8007addf8e..4056cafeb3 100644 --- a/builder/dockerfile/dispatchers.go +++ b/builder/dockerfile/dispatchers.go @@ -211,7 +211,7 @@ func from(b *Builder, args []string, attributes map[string]bool, original string return errors.Errorf("invalid name for build stage: %q, name can't start with a number or contain symbols", ctxName) } } else if len(args) != 1 { - return errExactlyOneArgument("FROM") + return errors.New("FROM requires either one or three arguments") } if err := b.flags.Parse(); err != nil { diff --git a/builder/dockerfile/dispatchers_test.go b/builder/dockerfile/dispatchers_test.go index 6b9b538102..b4d8bf60c1 100644 --- a/builder/dockerfile/dispatchers_test.go +++ b/builder/dockerfile/dispatchers_test.go @@ -20,7 +20,6 @@ type commandWithFunction struct { func TestCommandsExactlyOneArgument(t *testing.T) { commands := []commandWithFunction{ {"MAINTAINER", func(args []string) error { return maintainer(nil, args, nil, "") }}, - {"FROM", func(args []string) error { return from(nil, args, nil, "") }}, {"WORKDIR", func(args []string) error { return workdir(nil, args, nil, "") }}, {"USER", func(args []string) error { return user(nil, args, nil, "") }}, {"STOPSIGNAL", func(args []string) error { return stopSignal(nil, args, nil, "") }}}