Docker: Save Current State: Difference between revisions

From wiki.jacobjohns.com
jwiki>jjohns
Created
 
m 2 revisions imported
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[File:Docker Logo.png|center|frameless|250x250px]]
[[File:Docker Logo.png|center|frameless|250x250px]]
 
<hr /><br />
# Use <code>docker commit</code> to save a containers current state.
# Use <code>docker commit</code> to save a containers current state.
#* <code>docker commit nginx nginx:backup</code>
#* <code>docker commit nginx nginx:backup</code>

Latest revision as of 16:06, 27 July 2024



  1. Use docker commit to save a containers current state.
    • docker commit nginx nginx:backup
  2. This adds an image of the container to the local repository. So, if a change is made to a container and needs to be reverted it can be done so individually.
  3. To remove an image use docker images to list all images and docker rmi to remove the image by name:tag or Image ID.
    • docker images
    • docker rmi nginx:backup