From 2d65e30419c6c4addaa767618dfdbc14a2365da0 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Thu, 11 Sep 2014 05:58:50 -0700 Subject: [PATCH] builder: Fix an error check being done at the wrong spot in run dispatcher Docker-DCO-1.1-Signed-off-by: Erik Hollensbe (github: erikh) Upstream-commit: 91bed436215f272c2956abb969425ee0bfd3a998 Component: engine --- components/engine/builder/dispatchers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/engine/builder/dispatchers.go b/components/engine/builder/dispatchers.go index 201a76ada4..a5313fed4e 100644 --- a/components/engine/builder/dispatchers.go +++ b/components/engine/builder/dispatchers.go @@ -166,6 +166,10 @@ func workdir(b *Builder, args []string, attributes map[string]bool) error { // RUN [ "echo", "hi" ] # echo hi // func run(b *Builder, args []string, attributes map[string]bool) error { + if b.image == "" { + return fmt.Errorf("Please provide a source image with `from` prior to run") + } + args = handleJsonArgs(args, attributes) if len(args) == 1 { @@ -174,10 +178,6 @@ func run(b *Builder, args []string, attributes map[string]bool) error { args = append([]string{b.image}, args...) - if b.image == "" { - return fmt.Errorf("Please provide a source image with `from` prior to run") - } - config, _, _, err := runconfig.Parse(args, nil) if err != nil { return err