Backup and Export Docker Images Easily

Introduction

In this article I will share effective steps to run backup and restore images and containers on Docker. Previously to run this script you are expected to have installed Docker on the Linux operating system.
Backup images are very important. Sometimes applications with the same image can stop instantly and in this case we need a backup image. On the other hand, we want to run the image on someone else's locale where it doesn't work for us. Backup images will also be very helpful when we are going to upgrade where the original system for creating old images does not work with this backup we can reload images.


Backup Image

Here's how to back up the existing image.
  • Listing the image first by running the script:
 $ docker image ls
  • Save the image you want to back up as a .tar or .zip file
$docker save <imagename> -o imagename_backup_id.tar

The above command will generate a backup file on your local and can be shared as needed.


Restore Image

To run a backup image, use the script below. Make sure the same image name does not exist in local to avoid image conflicts.

$ docker load < imagename_backup_id.tar 

Komentar

Postingan populer dari blog ini

Tutorial Cara Menginstal dan Menjalankan Apache Kafka pada Windows 10

Cara Membuat Membuat Topic pada Kafka

Pertanyaan Interview Seputar Webmethods Developer