title: Unable to redirect error to a file in docker using bashscript
body: <p>I am trying to test how to redirect errors for docker and I keep getting an empty error output.</p>
  <p>Here is my bash script</p>
  <pre><code>#!/bin/bash
  
  sudo docker run --name test5 -e MyVar=&quot;test&quot; hello-world -arg 2 &gt;error
  </code></pre>
  <p><a href="https://i.stack.imgur.com/1kfcp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1kfcp.png" alt="empy error file" /></a></p>
  <p>Thanks so much!!</p>