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