compose icon indicating copy to clipboard operation
compose copied to clipboard

Add --quiet or --silent option to docker-compose

Open dkirrane opened this issue 10 years ago • 17 comments

I'm trying to assign the output of docker-compose run to a variable in bash.

Currently docker-compose run can print to console stuff like:

docker-compose run serviceabc ls
WARNING: The MVN_OPT variable is not set. Defaulting to a blank string.
Starting serviceabc
dir1
dir2
dir3

Can a -s --silent or -q --quiet option be added to docker-compose run avoid printing anything other than the command output.

I guess this would also make sense for other docker-compose commands too.

dkirrane avatar May 11 '16 13:05 dkirrane

You can redirect stderr to /dev/null (i.e. 2>/dev/null), which should have that exact effect.

shin- avatar May 11 '16 22:05 shin-

@shin- The quiet option is different from just sending all output nowhere, perhaps it's better explained as "don't show progress bars".

There should be an option that still shows a build steps, but not the actual progress bars which spray a huge amount of output on CI servers since the docker commands expect that your using a terminal that has the control codes to write over previous lines.

elliotchance avatar Jul 26 '16 01:07 elliotchance

@elliotchance That seems to be a different request from the one made by the original poster. Can you create a separate issue for it?

shin- avatar Jul 26 '16 18:07 shin-

@shin- thanks for letting me know :) #3770

elliotchance avatar Jul 27 '16 02:07 elliotchance

I'd specifically be interested in an option to quiet the download progress update, as it pollutes the travis logs

jbarciauskas avatar Apr 11 '17 13:04 jbarciauskas

Redirecting stderr works, but potentially hides real errors too, so I think adding --quiet would be better.

lelit avatar Apr 29 '17 08:04 lelit

+1

I would find this useful as well. Redirecting stderr is an OK workaround, but it has caused me some minor frustration as it hides actual errors.

RealSalmon avatar Sep 26 '17 15:09 RealSalmon

do we have any updates on this issue?

Bamieh avatar Sep 28 '17 16:09 Bamieh

This should have been fixed and released in 1.15? https://github.com/docker/compose/pull/4730

jbarciauskas avatar Sep 28 '17 17:09 jbarciauskas

Only for pull, AFAICT.

lelit avatar Sep 28 '17 17:09 lelit

Fixed with the addition of --log-level in #5703

shin- avatar Feb 23 '18 20:02 shin-

Note that --log-level should come before up, so up doesn't steal the flag, e.g.,

$ docker-compose --log-level ERROR up -d --build

charlesreid1 avatar Apr 01 '18 23:04 charlesreid1

It is not fixed:

# docker-compose --log-level CRITICAL restart container

Restarting compose_container_1 ... done

Vanav avatar Jul 05 '18 04:07 Vanav

Same here, still getting warnings even though setting --log-level ERROR :

WARNING: no logs are available with the 'none' log driver

And docker-compose version is 1.21.1... Any idea?

iabotsiTC avatar Jul 25 '18 15:07 iabotsiTC

Dependencies are also printed out in the run command:

$ docker-compose --log-level ERROR run my_service command.sh
Starting linked_container_1 ... done

I believe this issue should be reopened.

4rthem avatar Oct 14 '18 17:10 4rthem

@shin- Any word on this?

phillip-elm avatar Nov 11 '18 21:11 phillip-elm

Current issues with --log-level are tracked separately: #6026

shin- avatar Nov 11 '18 21:11 shin-