title: Is it possible to execute CMD at the middle of docker file?
body: <p>I am installing hadoop-0.20.2 using docker. I have two files one is for java installation and another is for hadoop installation. I am starting services using CMD command</p>
  
  <pre><code> cmd ["path/to/start-all.sh"]
  </code></pre>
  
  <p>Now, i want to to write third dockerfile which executes an example Map-Reduce job. But the problem is </p>
  
  <p>Third docker file depends on second hadoop-docker file. fo eg:</p>
  
  <pre><code> FROM sec_doc_file
  
   RUN /bin/hadoop fs -mkdir input
  </code></pre>
  
  <p>It requires hadoop services. But hadoop services ll be started only after running second docker file. But i want to run it as part of third docker file before starting MR job? Is it possible? If so, please provide an example. If not, what could be the other possibilities?</p>
  
  <pre><code> #something like
  
   From sec_doc_file
  
   #Start_Service
  
   RUN /bin/hadoop fs -mkdir input
  
   #continue_map_reduce_job
  </code></pre>