I have several containers that give many hundreds of lines of output when I do a docker-compose up and load all my services. Is there a way to filter that output easily or better yet, not have those services output to standard out, when doing docker-compose up?
One way to remove a running Docker container is first to stop that container using the docker stop command and then use the docker rm command to remove it. We can use the -f option to remove a single Docker container, multiple Docker containers, or all the Docker containers.
Using -f or --follow option, if you want to follow the logs: docker logs <container_id> --follow. If you want to see the last N log lines: docker logs <container-id> --tail N. If you want to see the specific logs, use the grep command: docker logs <container_id> | grep pattern.
Use detached mode when you start your docker compose
docker-compose up -d
If you want to see the logs of your containers, you can do:
docker-compose logs <name of your service that was defined in docker-compose file>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With