Skip to content

Commit

Permalink
Merge pull request moby#1636 from unclejack/1594-return_non_zero_when…
Browse files Browse the repository at this point in the history
…_encountering_error

1594 - return non-zero exit code if at least one container has failed to start
  • Loading branch information
crosbymichael committed Aug 26, 2013
2 parents 108b6c6 + d1ad0e2 commit b866254
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,15 +584,17 @@ func (cli *DockerCli) CmdStart(args ...string) error {
return nil
}

var encounteredError error
for _, name := range args {
_, _, err := cli.call("POST", "/containers/"+name+"/start", nil)
if err != nil {
fmt.Fprintf(cli.err, "%s\n", err)
encounteredError = fmt.Errorf("Error: failed to start one or more containers")
} else {
fmt.Fprintf(cli.out, "%s\n", name)
}
}
return nil
return encounteredError
}

func (cli *DockerCli) CmdInspect(args ...string) error {
Expand Down

0 comments on commit b866254

Please sign in to comment.