What is `docker commit` and why is it discouraged?
BeginnerConceptImages, Layers & Storage Drivers
Answer
It creates an image from a container's current state. It is non-reproducible, bakes in secrets and logs, and leaves no record of how it was made. Use it only for quick debugging snapshots; production images should come from a Dockerfile in version control.
More on Images, Layers & Storage Drivers
What is a Docker image made of?BeginnerWhat is a layer and when is one created?BeginnerWhat is a union filesystem / OverlayFS?IntermediateWhat is copy-on-write (CoW) in containers?IntermediateWhy does deleting a file in a later `RUN` not shrink the image?IntermediateWhat storage drivers does Docker support and which is default?Intermediate