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

Created on 11 May 2016  路  17Comments  路  Source: docker/compose

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.

Most helpful comment

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

All 17 comments

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

@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 That seems to be a different request from the one made by the original poster. Can you create a separate issue for it?

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

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

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

+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.

do we have any updates on this issue?

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

Only for pull, AFAICT.

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

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

It is not fixed:

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

Restarting compose_container_1 ... done

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?

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.

@shin- Any word on this?

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

Was this page helpful?
0 / 5 - 0 ratings