title: Docker Container prints the output only while exiting
body: <p>I wrote a python program and its Dockerfile:</p>
  
  <pre><code>import time
  print("Begin")
  time.sleep(100);
  print("End")
  </code></pre>
  
  <p>The image for it was created,and it was run using <code>docker run &lt;image-id&gt;</code> and the behaviour that surprises me is,
  after giving the run command in the console, it waits for sleep(100) seconds and prints <code>"Begin"</code> and <code>"End"</code> together.</p>
  
  <p>Why are we not getting the intermediate results while running it?</p>
  
  <p>Also how can I write a streaming app (in kafka or so), in this manner if it wont send the data immediately after it produces?</p>