1.Creating docker tar file from docker image.We can transfer that tar file and import to another docker instance.

root@deb-VirtualBox:~# docker image save mywebserver:v1>mywebserver.tar
root@deb-VirtualBox:~# ls -ltr mywebserver.tar
-rw-r–r– 1 root root 330399232 May 2 19:53 mywebserver.tar

2.Remove the existing docker image 

root@deb-VirtualBox:~# docker rmi -f mywebserver:v1
Untagged: mywebserver:v1

3.Please note the image is deleted

root@deb-VirtualBox:~# docker images

4.Now we can re-import docker image from docker tar

root@deb-VirtualBox:~# docker import mywebserver.tar mywebserver:v1

root@deb-VirtualBox:~# docker import mywebserver.tar mywebserver:latest

5.I have 2 images of the mywebserver

root@deb-VirtualBox:~# docker images

Leave a Reply

Your email address will not be published. Required fields are marked *