Docker Advanced: How to commit changes to an image

What happens when you deploy your app, and then you want to fix a bug, or simply release an update?

Once you have a container running, you can get its ID using docker ps, then you use docker commit to create a new tag for the image from it:

docker commit <id> <username>/<imagename>:<tagname>

You can also add a changelog message that lists what changed in the new version:

docker commit --change "description" <id> <username>/<imagename>:<tagname>

Lessons in this unit:

0: Introduction
1: Working with Images from the command line
2: Working with Containers from the command line
3: Troubleshooting container exits
4: ▶︎ How to commit changes to an image
5: Updating a deployed container
6: Accessing files outside a container
7: Dockerfile for Astro on Fly.io
8: Dockerfiles for Astro and Pocketbase on Railway

Join my AI Workshop!

The Web Development BOOTCAMP cohort starts in February 2026