mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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:
parent
576416c99a
commit
91bed43621
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue