title: Difference between "docker build" and "docker run" if we running dockerfile having .sh files
body: <p>This is my <strong>Dockerfile</strong> </p>
  
  <pre><code># This Dockerfile describes the standard way to build 
  FROM centos:latest
  MAINTAINER praveen
  # Run a root to allow "rpm"
  USER root
  WORKDIR /root/
  
  # Get the ACE-TAO rpm from seachange repo 
  COPY TAO-1.7.7-0.x86_64.rpm  /root/TAO-1.7.7-0.x86_64.rpm
  
  # Insatall the rpm  
  RUN rpm -ivh  /root/TAO-1.7.7-0.x86_64.rpm
  
  #Start the TAO service 
  #CMD /etc/init.d/tao start
  
  COPY namingServiceConfig.sh /
  RUN /namingServiceConfig.sh
  
  EXPOSE 13021
  EXPOSE 13022
  EXPOSE 13023
  ENV NS_PORTS=13021,13022,13023
  
  #ENTRYPOINT /etc/init.d/tao start &amp;&amp; bash
  </code></pre>
  
  <p>While doing the docker build 
  Whether it'll execute the shell script and reflect the changes as part images  or while running the images using <strong>docker run</strong>  its will  reflect the changes to container level </p>
  
  <p>In my case ,I'm suspecting  that, it is executing while docker build and docker run both time </p>
  
  <p>I'm using  below commands as part of building and running  via vagrant file  </p>
  
  <pre><code>d.build_image "/vagrant/tao", args: " -t tao/basic"
  
   d.run "tao/basic:latest",
              args: " -t -d"\
                    " --name tao-basic"\
                    " -p 13021:13021"\
                    " -e NS_PORT=13025,13026,13027"
  </code></pre>
  
  <p>let me know, need any more information </p>