Backup and Restore docker images in EC2 instance

docker pull ubuntu
docker run -it ubuntu bash
apt-get install telnet
apt-get install php
apt-get install apache2
find / -name telnet
find / -name php
find / -name apache2
docker commit container id imagename ======= container id mention in result of docker ps command
docker commit 44c854fce209 backup
docker images

For backup image in EC2 Instance

docker save --output imagename.lastest.tar imagename
docker save --output backup.lastest.tar backup
docker rm -f containerid
docker rmi -f imageid
docker ps
docker images

Restoring image from EC2 Instance

docker load --input imagename.lastest.tar
docker load --input backup.lastest.tar
docker run -it imagename bash
docker run -it backup bash
find / -name telnet
find / -name php
find / -name apache2

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store