title: How can I automatically run a docker container on/after image build?
body: <p>I'm new to docker so sorry if I miss something obvious</p>
  
  <p>My plan for the Dockerfile.</p>
  
  <ol>
  <li>Pull tomcat:7.0</li>
  <li>Start the server</li>
  <li>Download helper files and unzip them.</li>
  <li>Download the required war file and rename it to ROOT.war.</li>
  </ol>
  
  <p>I've managed to do this by running these commands manually.</p>
  
  <p><code>docker run -it --rm -p 8888:8080 tomcat:8.0</code></p>
  
  <p>Then manually doing the <code>wget</code>'s and renaming, although I would like this to all be done in the docker file.</p>
  
  <p>This is what I've managed to do so far.</p>
  
  <pre><code>FROM tomcat:7.0
  
  RUN /bin/bash -c "cd /usr/local/tomcat/webapps"
  
  
  RUN /bin/bash -c "wget -O files.zip https://***"
  RUN /bin/bash -c "unzip files.zip"
  
  RUN /bin/bash -c "rm -r ROOT"
  RUN /bin/bash -c "wget -O ROOT.war https://***"
  </code></pre>
  
  <p>Although I am not sure how to run the docker line from earlier 
  <code>docker run -it --rm -p 8888:8080 tomcat:8.0</code></p>
  
  <p>I've taken that line from the official Tomcat online <a href="https://hub.docker.com/_/tomcat/" rel="nofollow">here</a>. I noticed they mentioned this <code>Run the default Tomcat server (CMD ["catalina.sh", "run"]):</code> but I have no idea how to implement this.</p>