Skip to content

How to commit changes to a Docker 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>

→ Here's my latest YouTube video

→ I wrote 17 books to help you become a better developer, download them all at $0 cost by joining my newsletter

JOIN MY CODING BOOTCAMP, an amazing cohort course that will be a huge step up in your coding career - covering React, Next.js - next edition February 2025

Bootcamp 2025

Join the waiting list