title: Bash scripts exits on entering docker container
body: <p>Im trying to create a bash script for setting up docker and an application on a fresh server.</p>
  
  <p>pretty fresh to bash itself but i think ive got the just</p>
  
  <p>heres a snippet where my issue lies - </p>
  
  #
  
  <pre><code>docker run -d --name application -p 80:80 -d  tutum/apache-php
  docker run -d -p 3306:3306 --name=database --
  env="MYSQL_ROOT_PASSWORD=password1" mysql:latest
  echo "--------------------------------------------------------------------"
  echo "Docker is all done - run docker ps -a to see all created 
  containers!"
  echo "--------------------------------------------------------------------"
  echo "Moving onto installing application into app container!"
  echo "--------------------------------------------------------------------"
  docker exec -it application bash
  
  apt-get update &amp; apt-get install git &amp; cd /var/www/html
  </code></pre>
  
  #
  
  <p>on the line - <code>docker exec -it application bash</code></p>
  
  <p>It enters the container as expected but the bash script then stops because of this meaning the following commands after don't run</p>
  
  <p>Is there anyway I can get around this? I don't think there is but in case there are any bash wizards out there!</p>
  
  <p>Any help appreciated!</p>