I have unit tests running on my build server and would like to capture the log results for analysis when something fails. I have yet to find a way to redirect the output of
In later release docker-compose 1.7.x+, it is fixed. see https://github.com/docker/compose/issues/2227 & https://github.com/docker/compose/releases/tag/1.7.0
Before that, there is another way to achieve it, the solution of accepted answer is to access host files directly, Which may be not applicable for remote/security case.
Below we can get the container name from docker-compose ps command and let the docker logs command to loop
docker-compose ps | tail -n +3 | awk '{print $1}' | xargs -n1 docker logs