1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Clean some runCommandWithOutput accross integration-cli code

There is still ways to go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2017-01-05 12:38:34 +01:00
parent 766e53d8cb
commit 87e3fcfe1e
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3
19 changed files with 433 additions and 578 deletions

View file

@ -818,10 +818,12 @@ func buildImageFromContextWithOut(name string, ctx *FakeContext, useCache bool,
}
args = append(args, buildFlags...)
args = append(args, ".")
buildCmd := exec.Command(dockerBinary, args...)
buildCmd.Dir = ctx.Dir
out, exitCode, err := runCommandWithOutput(buildCmd)
if err != nil || exitCode != 0 {
result := icmd.RunCmd(icmd.Cmd{
Command: append([]string{dockerBinary}, args...),
Dir: ctx.Dir,
})
out := result.Combined()
if result.Error != nil || result.ExitCode != 0 {
return "", "", fmt.Errorf("failed to build the image: %s", out)
}
id, err := getIDByName(name)