<p>I have successfully shelled into a RUNNING docker container using</p>

<p>docker exec -i -t 7be21f1544a5 bash</p>

<p>I have made some changes to some json files and wanted to apply these changes to reflect online.</p>

<p>I am a beginner and have tried to restart, mount in vain. What strings I have to replace when I mount using docker run?</p>

<p>Is there any online sample?</p>

<pre><code>CONTAINER ID: 7be21f1544a5
IMAGE: gater/web
COMMAND: "/bin/sh -c 'nginx'"
CREATED: 4 weeks ago
STATUS: Up 44 minutes
PORTS: 443/tcp, 172.16.0.1:10010-&gt;80/tcp
NAMES: web
</code></pre>

<p>You can run either create a Dockefile and run:</p>

<pre><code>docker build . 
</code></pre>

<p>from the same directory where your <code>Dockerfile</code> is located.</p>

<p>or you can run:</p>

<pre><code>docker run -i -t &lt;docker-image&gt; bash
</code></pre>

<p>or (if your container is already running)</p>

<pre><code>docker exec -i -t &lt;container-id&gt; bash
</code></pre>

<p>once you are in the shell make all the changes you please. Then run:</p>

<pre><code>docker commit &lt;container-id&gt; myimage:0.1
</code></pre>

<p>You will have a new docker image locally <code>myimage:0.1</code>. If you want to push to a docker repository (dockerhub or your private docker repo) you can run:</p>

<pre><code>docker push myimage:0.1
</code></pre>
