title: Docker Exec with OpenSSL and stdin, stdout
body: <p>I'm trying to use docker exec with OpenSSL and piping like this. I have a container thats running called test1.</p>
  
  <pre><code>1. openssl genrsa -des3 -passout pass:123 2048 | docker exec -i test1 sh -c 'cat &gt;/key.pem
  2. docker exec test1 cat key.pem
      -----BEGIN RSA PRIVATE KEY-----
      Proc-Type: 4,ENCRYPTED
      DEK-Info: DES-EDE3-CBC,DE60A9F33B9E508D
  
      /uJYBfM6YwCkIgrgQSH......
  3. docker exec test1 cat key.pem | openssl req -subj '/CN=client' -new -key -out client.csr -passin pass:123
  
  write /dev/stdout: broken pipe
  </code></pre>
  
  <p>If I run these commands without using docker they work OK. Is/does docker do anything different with the stdin and stdout streams ?  </p>