title: Following the exec_run() output from docker-py in realtime
body: <p>Python noob here, I'm trying to use the <code>exec_run</code> function from <a href="https://docker-py.readthedocs.io/en/stable/" rel="nofollow noreferrer"><code>docker-py</code></a> to send commands to a detached docker container and have the output hitting stdout in real time. Here's a MWE:</p>
  
  <pre class="lang-python prettyprint-override"><code>import docker, sys
  client = docker.from_env()
  # start a detached container
  box = client.containers.run(image = "ubuntu",
                              remove = True,
                              detach = True,
                              tty = True,
                              command = "/bin/bash")
  # send a test command
  box.exec_run(cmd = "find /") # gives no output in the terminal when run
  
  # same again, but save the output
  run = box.exec_run(cmd = "find /")
  print(run.output.decode("utf-8"))
  
  box.stop()
  sys.exit()
  </code></pre>
  
  <p>I can grab the output after the fact by storing it in a variable, but I can't seem to get the real time output. I actually want to give it long running processes, so it's preferable to see the output as it happens (as well as saving it). Is this difficult to do, or am I missing something really basic here?</p>