Docker save changes in the container

Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  

If you made any change on container, that will be there on that particular container only. next time when you run the container, it will be the new instance of the images.
You need to commit the changes you make to the container and then run it. Try this:

1
2
<code>
</code>
<code>
</code>

Get the container id using this command:

1
2
<code>sudo docker ps -l
</code>
<code>sudo docker ps -l
</code>

Commit changes to the container:

1
2
<code>sudo docker commit <container_id> iman/ping 
</code>
<code>sudo docker commit <container_id> iman/ping 
</code>

Then run the container:

1
<code>sudo docker run iman/ping ping www.google.com</code>
<code>sudo docker run iman/ping ping www.google.com</code>

Share the joy
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.