I\'m not entirely sure what is going on here but it appears that stdout is being buffered when I run my code in a container, but not if I run it on the host or on OSX.
h
I faced same issue and looks like root cause is "stdout buffering". You can start reading http://www.pixelbeat.org/programming/stdio_buffering/ and google in case of any additional question. I failed to resolve it by "stdbuf" or any linux/app settings and changed source code of the console app I want to dockerize to proceed with file flush on each write.
(my configuration is strange because of a lot of reason, but it is: the app has configured log output to the file named "/dev/stdout" and it performs file_flush on each log write and docker can show messages in real time on "docker logs -f XXXXX")