diff --git a/builder/dockerfile/dispatchers.go b/builder/dockerfile/dispatchers.go index fb064e5971..9a91756002 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 77506d712a..2ce8d75e53 100644 --- a/builder/dockerfile/dispatchers_test.go +++ b/builder/dockerfile/dispatchers_test.go @@ -22,7 +22,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, "") }}}