简体   繁体   English

过滤 docker-compose 输出

[英]Filter docker-compose output

I have several containers that give many hundreds of lines of output when I do a docker-compose up and load all my services.当我执行 docker-compose up 并加载所有服务时,我有几个容器可以提供数百行输出。 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?在进行 docker-compose up 时,有没有办法轻松或更好地过滤该输出,而不是将这些服务输出到标准输出?

Use detached mode when you start your docker compose启动 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>
docker-compose up <service>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM