From fbb25d42f08fdb5ffb948bcb523a035609d1c235 Mon Sep 17 00:00:00 2001 From: Boaz Shuster Date: Wed, 28 Oct 2015 02:29:21 +0200 Subject: [PATCH] Change the quiet flag behavior in the build command Right now, the quiet (-q, --quiet) flag ignores the output generated from within the container. However, it ought to be quiet in a way that all kind of diagnostic output should be ignored, unless the build process fails. This patch makes the quiet flag behave in the following way: 1. If the build process succeeds, stdout contains the image ID and stderr is empty. 2. If the build process fails, stdout is empty and stderr has the error message and the diagnostic output of that process. If the quiet flag is not set, then everything goes to stdout and error messages, if there are any, go to stderr. Signed-off-by: Boaz Shuster --- contrib/completion/fish/docker.fish | 2 +- docs/reference/commandline/build.md | 2 +- man/docker-build.1.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/completion/fish/docker.fish b/contrib/completion/fish/docker.fish index 33abfd0d37..17af1c0171 100644 --- a/contrib/completion/fish/docker.fish +++ b/contrib/completion/fish/docker.fish @@ -95,7 +95,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l force-rm -d ' complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l help -d 'Print usage' complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l no-cache -d 'Do not use cache when building the image' complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l pull -d 'Always attempt to pull a newer version of the image' -complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s q -l quiet -d 'Suppress the verbose output generated by the containers' +complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s q -l quiet -d 'Suppress the build output and print image ID on success' complete -c docker -A -f -n '__fish_seen_subcommand_from build' -l rm -d 'Remove intermediate containers after a successful build' complete -c docker -A -f -n '__fish_seen_subcommand_from build' -s t -l tag -d 'Repository name (and optionally a tag) to be applied to the resulting image in case of success' diff --git a/docs/reference/commandline/build.md b/docs/reference/commandline/build.md index 88e57dce54..0219be0fbc 100644 --- a/docs/reference/commandline/build.md +++ b/docs/reference/commandline/build.md @@ -30,7 +30,7 @@ parent = "smn_cli" --memory-swap="" Total memory (memory + swap), `-1` to disable swap --no-cache=false Do not use cache when building the image --pull=false Always attempt to pull a newer version of the image - -q, --quiet=false Suppress the verbose output generated by the containers + -q, --quiet=false Suppress the build output and print image ID on success --rm=true Remove intermediate containers after a successful build --shm-size=[] Size of `/dev/shm`. The format is ``. `number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you omit the unit, the system uses bytes. If you omit the size entirely, the system uses `64m`. -t, --tag=[] Name and optionally a tag in the 'name:tag' format diff --git a/man/docker-build.1.md b/man/docker-build.1.md index 4a87c4d515..52451c1d75 100644 --- a/man/docker-build.1.md +++ b/man/docker-build.1.md @@ -81,7 +81,7 @@ set as the **URL**, the repository is cloned locally and then sent as the contex Always attempt to pull a newer version of the image. The default is *false*. **-q**, **--quiet**=*true*|*false* - Suppress the verbose output generated by the containers. The default is *false*. + Suppress the build output and print image ID on success. The default is *false*. **--rm**=*true*|*false* Remove intermediate containers after a successful build. The default is *true*.