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)
This commit is contained in:
Erik Hollensbe 2014-09-11 05:58:50 -07:00
parent 576416c99a
commit 91bed43621
1 changed files with 4 additions and 4 deletions

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