docker image from container code example
Example 1: how to build docker image
docker build <Dockerfile path> -t image-name
Example 2: commit container to image
sudo docker commit [CONTAINER_ID] [new_image_name]
Example 3: docker commit
docker commit CONTAINER_ID CONTAINER_NAME:TAG