title: Run a simple shell script before running CMD command in Dockerfile
body: <p>I have a dockerfile and the last command is</p>
  
  <p><code>CMD ["/opt/startup.sh"]</code></p>
  
  <p>Now i have another shell script i.e <code>replacevariables.sh</code> and i want to execute the following command in my dockerfile.</p>
  
  <p><code>sh replacevariables.sh ${app_dir} dev</code></p>
  
  <p>How can i execute this command. It is a simple script which is basically going to replace some characters of files in <code>${app_dir}</code>. What can be the solution for this because when i see any kind of documentation they all suggest to run only one sh script.</p>