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:
parent
766e53d8cb
commit
87e3fcfe1e
19 changed files with 433 additions and 578 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue