2

By default docker compose up transfer stdout from containers to both stdout (console) and log file(s). With following line is service definition:

logging:
      driver: none

docker will not produce logs but still print everything to STDOUT. Is there any way to stop printing for selected containers?

The following is not optimal solution:

  1. docker compose up > /dev/null this will hide info from all containers I want to hide only for selected,
  2. go thru images and disable printing in those which are to verbose - yes this is an option but rather time consuming especially when you use 3rd party image,
  3. make bash script with lines
docker compose up verbose_container > /dev/null &
docker compose up silent_container &

this will make problem with dependency - probably it will be needed to add properly adjusted sleep between lines. In short seems far from being ideal

so

Is there any elegant way to stop printing to stdout for selected containers?

rmrmg
  • 51
  • 4
  • 1
    You could run `docker-compose up -d` to start everything in the background and then look at the `docker-compose logs` of selected containers, perhaps. – David Maze Sep 14 '22 at 11:15

0 Answers0