Docker Community Forums

Share and learn in the Docker community.

Is docker commit an atomic operation? (safe to run on a running container)

(Assaf Lavie) #1

Does running docker commit on a running container produce a consistent, point-in-time image?

Are there disadvantages to doing this regularly? Does it introduce any incremental overhead in terms of the storage driver?

(for the record, I am aware of volumes and data-containers and the best practices regarding backups with docker, I’m just trying to understand how commit works)

(Andy Rothfusz) #2

I don’t know if it is atomic – that would take a careful code review. So to be on the safe side, I would recommend using docker pause on a running container before docker commit, then docker unpause.

If you end up doing the careful code review, please let us know what you learn!

(Sven Dowideit) #3

and to confirm it -

by default docker commit pauses the container.


Docker Engineer
Ask me anything …
Brisbane, Australia (UTC+10)