DOCKER CONCEPT FOR DBA– PART 9 : How to use docker tar command in docker to re-instantiate new docker

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

About the Author

debasis maity

12+ years of rich experience on Database Administrations and on Infrastructure Solution Architect. AWS Certified Solution Architect and Senior Oracle DBA

Leave a Reply

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