Let’s say you have a container bd91ca3ca3c8 running, and you want to create a new image after you made changes in the container. Generating another image will allow you to preserve your changes.
In that case you can run:
docker commit -p -a "author_here" -m "your_message" bd91ca3ca3c8 name_of_new_image
-p pauses the container while commit command is building the new image.
-a allows you to supply author information of the new image.
-m allows you to add a comment just as in the Git.