From 9651fbd1974797bbf9ce447b78d6309c857be9e4 Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 3 Jan 2017 11:40:44 -0800 Subject: [PATCH] Windows to Linux build warning to stdout Signed-off-by: John Howard When building a Dockerfile from a Windows client on a Linux daemon, a "security warning" is printed on stderr. Having this warning printed on stderr makes it difficult to distinguish a failed build from one that's succeeding, and the only way to suppress the warning is through the -q option, which also suppresses every output. This change prints the warning on stdout, instead of stderr, to resolve this situation. --- command/image/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/image/build.go b/command/image/build.go index 1e4e8a267f..5d6e611406 100644 --- a/command/image/build.go +++ b/command/image/build.go @@ -334,7 +334,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error { // Windows: show error message about modified file permissions if the // daemon isn't running Windows. if response.OSType != "windows" && runtime.GOOS == "windows" && !options.quiet { - fmt.Fprintln(dockerCli.Err(), `SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`) + fmt.Fprintln(dockerCli.Out(), `SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.`) } // Everything worked so if -q was provided the output from the daemon