title: docker entrypoint script fails to run
body: <p>I have a script <code>startScript.sh</code> that I want to run after the docker container completely starts (including loading all services that the container is supposed to start)</p>
  
  <p>After that I want to run a script: <code>startScript.sh</code></p>
  
  <p>This is what I do:</p>
  
  <pre><code>sudo docker run -p 8080:8080 &lt;docker image name&gt; " /bin/bash -c ./startScript.sh"
  </code></pre>
  
  <p>However this gives me an error:</p>
  
  <pre><code>WFLYSRV0073: Invalid option '/bin/bash'
  </code></pre>
  
  <p>Even tried different shells still same error. Even tried passing just the script file name. Still did not help.</p>
  
  <p>Note: I know that the above file is in the container in the root folder: /
  In fact I once entered the container by doing: <code>sudo docker exec</code> and manually ran that script file and it worked.
  But when I try to automatically do it as above, it does not work for me.</p>
  
  <p>Some questions:
  1. Please suggest what could be the issue.
  2. I want to run that script after the container has started completely and is up and running - including all the services that are part of it. Is this the right way to even do it? Or does this try to run while  the container is starting up?</p>