How to run python script in docker with the script being sent dynamically to docker container?
<p>How to run python script in docker with the script being sent dynamically to docker container ?</p>

<p>Also, it should handle multiple simultaneous connections. For example, if two run is executed by two people at once, it should not override the file created by one person by the another. </p>

<p>Normally, you <a href="https://docs.docker.com/engine/tutorials/dockervolumes/#/mount-a-host-file-as-a-data-volume" rel="nofollow">Mount a host file as a data volume</a>, or, in your case, a <a href="https://docs.docker.com/engine/tutorials/dockervolumes/#/mount-a-host-directory-as-a-data-volume" rel="nofollow">host directory</a>.<br>
See the <a href="https://hub.docker.com/_/python/" rel="nofollow">python image</a>:</p>

<pre><code>docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py
</code></pre>

<p>That way, if a file is created in that mounted folder, it will be created on the host hard-drive, and won't be overridden by another user executing the same script in his/her own container.</p>

<hr>

<p>For an Ubutu image, you need</p>

<ul>
<li>an initial copy of the Git repo, cloned as a bare repo (<code>git clone --mirror</code>). </li>
<li>an Apache installed, listening for Git request</li>
</ul>

<p>When you fetch a PR, you can run a new container, and push that PR branch to the container Git repo. A post-receive hook on that container repo can trigger a python script.
- then you can</p>

python docker