Make 'docker build' send non-err output to stdout

Right now 'docker build' will send:
   Sending build context to Docker daemon
to stderr, instead of stdout.  This PR fixes that.

I looked in the rest of api/client/commands.go for other cases
that might do this and only one jumped out at me:
  https://github.com/docker/docker/blob/master/api/client/commands.go#L2202
but I think if I changed that to go to stdout then it'll mess people up
who are expecting just the container ID to be printed to the screen and
there is no --quiet type of flag we can check.

Closes #9404

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 5c91bb93a7e35b2d443090cabc7ec0a2ca59b6ee
Component: engine
This commit is contained in:
Doug Davis
2014-12-04 14:06:40 -08:00
parent d749cd5cd2
commit 52bfe6086a
3 changed files with 36 additions and 1 deletions

View File

@ -3523,3 +3523,19 @@ func TestBuildWithTabs(t *testing.T) {
}
logDone("build - with tabs")
}
func TestBuildStderr(t *testing.T) {
// This test just makes sure that no non-error output goes
// to stderr
name := "testbuildstderr"
defer deleteImages(name)
_, _, stderr, err := buildImageWithStdoutStderr(name,
"FROM busybox\nRUN echo one", true)
if err != nil {
t.Fatal(err)
}
if stderr != "" {
t.Fatal("Stderr should have been empty, instead its: %q", stderr)
}
logDone("build - testing stderr")
}