Commiting Changes to Docker images and containers

in #docker3 years ago


This is a walkthrough of how to commit changes to docker images and containers. You need to do this if you make configuration changes to any docker images. By committing changes to the docker images you can backup and clone them.

Docker is a very powerful tool you can use to isolate applications, therefore, you won't have them on a single server. However, some docker images don't save changes to their container when a restart happens. You will notice that when a reboot or unexpected outage happens all your configuration will be gone since the creation of container. The Ubiquiti Unifi Controller docker image is a good example of this.

Here are the following commands to commit those changes to a new image

sudo docker ps -l
Note: This shows all your containers you need to copy Container ID for the one you want to commit changes on.

sudo docker commit CONTAINER_ID_GOES_HERE IMAGENAME:TAG
Example Syntax: sudo docker commit 520b0f024bf6 unifi:latest-06-21-2018

docker-screenshot

Now if you have any issues you can simply create a new container using the image you created above.

Leave any Questions and Comments below and I will get back to you. I regularly publish on YouTube, Steemit, and christitus.com so if you’d like to see more videos please like, subscribe, and follow me.


Posted from my blog with SteemPress : https://www.christitus.com/2018/06/21/commiting-docker-images/

Sort:  

Hi, @christitus!

You just got a 0.14% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Coin Marketplace

STEEM 0.50
TRX 0.09
JST 0.067
BTC 50220.79
ETH 4330.64
BNB 583.42
SBD 6.29