Create an Image of Docker Container
Hello Folks. I am back again with another simple tutorial.
While we are making changes in container, we need to make an image out it so that it can be copied to different system. Following is the process to make an image and later on create container out of that image.
List the running containers
$ sudo docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 462d8a700300 ubuntu:bionic "bash" 28 hours ago Up About an hour boring_wescoff
Next is to create the image. Image name is formatted as “space”/”name”:”tag”
$ sudo docker commit 462d8a700300 apex/webserver:1.0
List the new image
$ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE apex/webserver 1.0 08715679d2b5 3 seconds ago 777MB
And we are done. Try it yourself.