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
Now if you have any issues you can simply create a new container using the image you created above.
I live stream on Chris Titus Tech YouTube Channel every Friday at 10 AM CST and archive clips to Titus Tech Talk. I also regularly publish to christitus.com, but if you’d like to contact me directly or want to contribute to help keep these articles and videos being made consider joining the CTT members.
Two Memberships exist:
- ChrisTitus.com Members Section (CC Only)
- Full Archive of All Unlisted Live Streams
- Direct Members Only Email
- Monthly Members Only Video
- Starting at $2 Per Month (100% of Proceeds goes to Chris Titus Tech)
- YouTube Chris Titus Tech Membership (All Payments Accepted)
- YouTube Emojis for Comments and Live Chat
- YouTube Badges that changes based on membership time for comments and chat.
- All YouTube comments are highlighted when I review comments daily.
- Immediate Access to Full Live Streams
- $4.99 Per Month (70% of the Proceeds goes to Chris Titus Tech)