title: Python app does not print anything when running detached in docker
body: <p>I have a Python (2.7) app which is started in my dockerfile:</p>
  
  <pre><code>CMD ["python","main.py"]
  </code></pre>
  
  <p><em>main.py</em> prints some strings when it is started and goes into a loop afterwards:</p>
  
  <pre><code>print "App started"
  while True:
      time.sleep(1)
  </code></pre>
  
  <p>As long as I start the container with the -it flag, everything works as expected:</p>
  
  <pre><code>$ docker run --name=myapp -it myappimage
  &gt; App started
  </code></pre>
  
  <p>And I can see the same output via logs later:</p>
  
  <pre><code>$ docker logs myapp
  &gt; App started
  </code></pre>
  
  <p>If I try to run the same container with the -d flag, the container seems to start normally, but I can't see any output:</p>
  
  <pre><code>$ docker run --name=myapp -d myappimage
  &gt; b82db1120fee5f92c80000f30f6bdc84e068bafa32738ab7adb47e641b19b4d1
  $ docker logs myapp
  $ (empty)
  </code></pre>
  
  <p>But the container still seems to run;</p>
  
  <pre><code>$ docker ps
  Container Status ...
  myapp     up 4 minutes ... 
  </code></pre>
  
  <p>Attach does not display anything either:</p>
  
  <pre><code>$ docker attach --sig-proxy=false myapp
  (working, no output)
  </code></pre>
  
  <p>Any ideas whats going wrong? Does "print" behave differently when ran in background?</p>
  
  <p>Docker version:</p>
  
  <pre><code>Client version: 1.5.0
  Client API version: 1.17
  Go version (client): go1.4.2
  Git commit (client): a8a31ef
  OS/Arch (client): linux/arm
  Server version: 1.5.0
  Server API version: 1.17
  Go version (server): go1.4.2
  Git commit (server): a8a31ef
  </code></pre>