title: How to automate docker to run script within container and notify completion to host?
body: <p>I would like to automate the build process of my application through the following steps:</p>
  
  <ol>
  <li>Launch my <code>build-system</code> container that has all dependencies and scripts for making the final exe of my application.</li>
  <li>Within the build-system container fire a bash script that starts the build process.</li>
  <li>When the build completes, transfer the exe to the host machine either by using <code>docker cp</code> or by attaching a volume while launching the container.</li>
  <li>Transfer the exe to a new <code>dist-system</code> container, which is essentially the final image that will be stored in Docker hub.</li>
  <li>Install the application within the dist-system, make custom configurations by firing another bash script in that container.</li>
  <li>When step 5 completes, get back to the host machine and run <code>docker commit</code> of the dist-system container and then <code>docker push</code> the image to Docker hub from the host machine.</li>
  </ol>
  
  <p>My question relates specifically to points 3 and 6 where I need to know that the bash scripts have completed execution within the containers.  Only then I would like to fire docker commands in the host machine.  Is there a way in which docker can be notified of bash script execution within containers?</p>