Compose: Option to not print color

Created on 13 Aug 2015  路  6Comments  路  Source: docker/compose

I don't see any option in the usage to disable printing of color codes. Can we have color disabled if not run from an interactive tty and if an option is passed?

Most helpful comment

When I do

 docker-compose up --no-color

it prints ... done with color. Furthermore, down etc. don't seem to accept this option. Do I miss something?

All 6 comments

$ docker-compose up --no-color

This should be properly documented. Neither the CLI usage nor the CLI reference page in the docs make reference to it. It was pretty hard to found by googling.

When I do

 docker-compose up --no-color

it prints ... done with color. Furthermore, down etc. don't seem to accept this option. Do I miss something?

I have seen the same. "done" still prints in green.

$ docker-compose --version
docker-compose version 1.11.2, build dfed245

docoker-compose logs --no-color works.

Note: the --no-color options must be specified after logs

The solution for preventing colour code output in most docker-compose operations is docker-compose --no-ansi

See: https://docs.docker.com/compose/reference/overview/

Note this won't stop docker-compose logs from producing colour codes if the logs contain them, and from what I can tell docker-compose logs --no-color has no effect on the log content itself.

Was this page helpful?
0 / 5 - 0 ratings