title: How to execute commands in docker container as part of bash shell script
body: <p>I would like to write a bash script that automates the following:</p>
  
  <p>Get inside running container</p>
  
  <pre><code>docker exec -it CONTAINER_NAME /bin/bash
  </code></pre>
  
  <p>Execute some commands:</p>
  
  <pre><code>cat /dev/null &gt; /usr/local/tomcat/logs/app.log
  exit
  </code></pre>
  
  <p>The problematic part is when <code>docker exec</code> is executed. The new shell is created, but the other commands are not executed.</p>
  
  <p>Is there a way to solve it?</p>