2

Is docker commit an atomic operation?

Meaning, does it create a consistent snapshot of the container's file-system at the moment of its execution?

Assaf Lavie
  • 73,079
  • 34
  • 148
  • 203
  • possible duplicate of [docker commit running container](http://stackoverflow.com/questions/23989845/docker-commit-running-container) – helmbert Jul 07 '15 at 15:40
  • @helmbert, notice that question was not answered, so closing this one would only reduce the chance of any of them being answered. – Assaf Lavie Jul 07 '15 at 15:42

1 Answers1

2

docker commit is not an atomic operation.

The only way to accomplish an atomic commit would be to take advantage of filesystem- or storage driver- specific features to support snapshotting, and to the best of my knowledge there is no such support in Docker right now. Absent this support, there is always the chance that a file may be modified between the time the commit operation starts and the time it completes.

larsks
  • 277,717
  • 41
  • 399
  • 399