What is the purpose of the "-i" and "-t" options for the "docker exec" command?
<p>To be honest, I have always been confused about <code>docker exec -it …</code>, <code>docker exec -i …</code> and <code>docker exec -t …</code>, so I decide to do a test:  </p>

<ol>
<li><p><code>docker exec -it …</code>:</p>

<pre><code># docker exec -it 115c89122e72 bash
root@115c89122e72:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
</code></pre>

<p>It works normally.</p></li>
<li><p><code>docker exec -i …</code>:</p>

<pre><code># docker exec -i 115c89122e72 bash
^C
</code></pre>

<p>The command hangs and I have to use <kbd>Ctl</kbd> + <kbd>c</kbd> to interrupt it.</p></li>
<li><p><code>docker exec -t …</code>:</p>

<pre><code># docker exec -t 115c89122e72 bash
root@115c89122e72:/# ls
^C
</code></pre>

<p>It enters the container successfully but hangs on executing the first command.</p></li>
</ol>

<p>So it seems there is no point in having the <code>docker exec -i …</code> and <code>docker exec -t …</code> commands. Could anyone elaborate on why there exist <code>-i</code> and <code>-t</code> options for the <code>docker exec</code> command?</p>