Docker Compose CLI utility wrapper which makes docker-compose quieter.
This Docker Compose CLI utility wrapper allows users to hide Starting <...> / Stopping <...> and similar messages from docker-compose's output.
Docker Compose is overly verbose when starting containers for a service:
$ docker-compose --project-name test run --rm test_service bash
Creating network "test-bash_default" with the default driver
Creating test-bash_postgresql-server_1 ... done
Creating test-bash_solr-zookeeper_1 ... done
Creating test-bash_extract-article-from-page_1 ... done
Creating test-bash_rabbitmq-server_1 ... done
Creating test-bash_solr-shard-01_1 ... done
Creating test-bash_import-solr-data-for-testing_1 ... done
$ docker-compose --project-name test down --volumes
Stopping test-bash_import-solr-data-for-testing_1 ... done
Stopping test-bash_solr-shard-01_1 ... done
Stopping test-bash_postgresql-server_1 ... done
Stopping test-bash_solr-zookeeper_1 ... done
Stopping test-bash_extract-article-from-page_1 ... done
Stopping test-bash_rabbitmq-server_1 ... done
Removing test-bash_import-solr-data-for-testing_1 ... done
Removing test-bash_solr-shard-01_1 ... done
Removing test-bash_postgresql-server_1 ... done
Removing test-bash_solr-zookeeper_1 ... done
Removing test-bash_extract-article-from-page_1 ... done
Removing test-bash_rabbitmq-server_1 ... done
Removing network test-bash_defaultSetting --log-level to WARNING doesn't seem to help, and multiple issues and PRs to address the issue have been unsuccessful so far:
This wrapper monkey-patches ParallelStreamWriter for it to take into account --log-level setting and make the output quieter, and then runs Compose's CLI normally.
- This is not a fork, so the utility should work with newer versions of Compose as long as
ParallelStreamWriterinterface remains the same as it was at the time of writing this hack. So far, it's been tested withdocker-composeversion 1.25.0 and Python 3.7. - It doesn't have any third party dependencies (except for Docker Compose itself of course).
- It doesn't have to be installed, you can just add this repository as a submodule to your project, or copy-paste the
docker-compose-just-quieterscript somewhere. With that said, you canpip3 install docker-compose-just-quietertoo if you feel like it.
- Install Docker Compose using your favourite method, e.g.:
$ pip3 install docker-compose-
Place
docker-compose-just-quieterscript somewhere in yourPATH, or add directory withdocker-compose-just-quieterto yourPATH. -
Use
docker-compose-just-quieterscript instead of vendor'sdocker-composescript, e.g.:
docker-compose-just-quieter ps- Reduce verbosity level with
--log-levelargument just like you would fordocker-composeitself, e.g.:
$ docker-compose-just-quieter --log-level WARNING run test_service bash