docker-compose yml在Docker中运行nosetests,输出到控制台被延迟

当我使用docker-compose run integration_tests fab tests.integration_tests运行在testing目录中的testing上运行nosetests的fab任务时,我会看到按照我的预期stream式传输到屏幕上的testing输出,包括运行每个testing时的进度点。

但是,当我尝试使用docker-compose -f tests.yml up integration_tests运行相同的命令时docker-compose -f tests.yml up integration_tests输出会以块的forms出现,就好像它被缓冲并间隔地写入屏幕一样。

如何在使用yml文件时使输出stream连续传输?

我的tests.yml文件(版本2.3)包含:

 integration_tests: image: my_service command: fab tests.integration_tests tty: true