[Docker] Backup / Restore Images

Images should be a kind of "throw-away" format: You got your Dockerfile, and as soon as you need to run a specific container, you should just built it from scratch: All the latest security updates, software versions - great. However, sometimes you got a bit of specialized stuff which you want to backup for later use.

I found a good answer to that topic: http://stackoverflow.com/questions/26707542/how-to-backup-restore-docker-image-for-deployment


Backup:
docker save myusername/myproject:latest | gzip -c > myproject_img_bak20141103.tgz

Restore:
gunzip -c myproject_img_bak20141103.tgz | docker load

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.