Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I stop a container before commit it?

In most tutorials, they stop a container before commit it. For example: https://docs.oracle.com/cd/E52668_01/E54669/html/section_c5q_n2z_fp.html

Once I forgot to stop it before commit. But the commit is still successfully done! I am wonder whether there are any hidden damages.

like image 601
Clarence Avatar asked Jan 19 '16 03:01

Clarence


Video Answer


1 Answers

By default, docker will automatically pause the container during commit to make sure it's committing the container in a consistent state, so committing a running container should not be a problem; from the docs:

By default, the container being committed and its processes will be paused while the image is committed. This reduces the likelihood of encountering data corruption during the process of creating the commit. If this behavior is undesired, set the ‘p’ option to false.

like image 148
thaJeztah Avatar answered Oct 10 '22 16:10

thaJeztah