builder: Fix an error check being done at the wrong spot in run

dispatcher

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 91bed436215f272c2956abb969425ee0bfd3a998
Component: engine
This commit is contained in:
Erik Hollensbe
2014-09-11 06:00:24 -07:00
parent 665c625297
commit 2d65e30419
+4 -4
View File
@@ -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