docker container backup

How To Snapshot Backup of running a Container In Docker

Today we will learn How To Take Snapshot of Running Container so we can restore it later if we required it. Having a backup of everything is better than nothing. You can have a backup of Docker containers as well as a snapshot of docker images and save the container.

Check Out: JfrogArtifactory Service Failed To Start On CentOS 7

Having a Snapshot of a container is also known as Backup. There are two ways of taking a backup of a container in docker. you can easily perform these steps in the docker to save all the running container.

Two Ways of Container Backup

Check Out: Update Memory Size of Running Container

Way 1: I’m having two running containers on my docker-machine.

 docker save all images

I’m going to take a backup of mysqltest container.

docker commit -p 78e701a98334 mysqltest-backup

Container-id = 78e701a98334

Backup name = mysqltest-backup

snapshot of docker container

Check Out: Monitor Health of a Container

As you can see the backup of mysqltest created. This will create a backup as an image.

docker images

Way 2: You can also take the backup of a container image in tar form.

docker save -o mysqltest-backup.tar mysqltest-backup

Check Out: Check Logs Of a Container

YouTube link: Backup of Container

You’re done docker save container backup docker images snapshot of docker container

LEAVE A REPLY

Please enter your comment!
Please enter your name here