compose: "docker-compose run -T" inconsistently outputs stdout / stderr?
I’ve noticed that docker-compose run -T
seems to behave inconsistently from run to run with respect to outputting stderr and stdout.
For example, on repeated invocations of the following command:
$ docker-compose run -T web python3 -c "import sys; print(\"err\\n\", file=sys.stderr); print(\"stdout\\nstdout\\nstdout\\nstdout\\n\")"
the “err” usually doesn’t print out (but sometimes does), and the “stdout” messages usually (but don’t always) print.
This is a follow-up to issue #3239.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22
Commits related to this issue
- workaround for "docker-compose run -T" inconsistently outputs stdout / stderr? see also: https://github.com/docker/compose/issues/3267 — committed to blauerberg/drush-scm by blauerberg 7 years ago
We’ve run in, what seems like, the same issue with
docker-compose 1.7.1, build 0a9ab35
onMac OS X El Capitan - 10.11.5 (15F34)
.When running a bash script inside the container, like such:
a random amount of lines will be missing from
stdout
, when docker-compose is executed like such:Both with and without the
-T
flag. Whendocker-compose
is ran directly from terminal, it will only have partial output with the-T
flag. When removing thesleep 0.1
from the bash script, it will always output all lines.We’ve tested it with
alpine:latest
,debian:latest
anddebian:wheezy
without any extras (except bash).Using:
docker-machine version 0.7.0, build a650a40
Docker version 1.11.2, build b9f10c9
VirtualBox version 5.0.20 r106931
@shadiakiki1986 What you describe seems unrelated because this issue is about
docker-compose run
and you’re describing something aboutdocker-compose build
. Also, it seems like “Building service” should go to stderr rather than stdout since that is a progress message.@shin- This particular problem no longer occurs for us when using Docker for Mac beta.