title: How to run container and execute python on docker in one command?
body: <p>We have a very small python code which we need to run on container.  Following two commands are working fine ,
  I want to merge them in one ? the ultimate goal is container should be up(base on image)  , run python and exit by itself.</p>
  <pre><code>docker run --name mycontainer -v /opt/testuser/pythoncode/:/usr/src/app/ -t -d pythonimage:latest
  docker exec -it mycontainer python3 /usr/src/app/subfolder/createfile.py
  </code></pre>
  <p>I tried -c &quot;/bin/bash python3 /usr/src/app/subfolder/createfile.py&quot;  this didnt work , it just.</p>