Docker |Committing Changes & Listing Containers


  • CentOS running
  • Docker Installed
  • Docker images pulled 
  • Docker images running

What you need to know: 

  1. Committing Changes 
    1. When you deploy a docker image, the changed that you make will only apply to that specific container. Once it’s destroyed, all of those changes, modifications will be lost. Committing will save the state and create a docker image with all the configurations you have made. 
    2. docker commit -m “What did you do to the image” -a “Author Name” container-id repository/new_image_name
    3. After the docker image has been created, you can deploy it as many times as you see fit. 
      1. docker images – to list images
  2. Listing Containers 
    1. Why is this important? On your server, workstation, RPI, you will have docker containers actively running and not running. The command, “docker ps”, will show you what containers are currently active. 
      1. To view all active and inactive containers, use “docker ps -a” 
      2. “docker ps -l”, will show you the latest docker images you created
      3. Finally, if you want to kill a docker instance “docker stop (container-id)”
        1. The container ID will be found in the output of “docker ps” 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s