Docker Container Backup

CommunityEnterprise

Containers are very light system level virtualization with less overhead because programs in virtual partitions use the operating system’s normal system call interface and do not need to be subjected to emulation or be run in an intermediate virtual machine. Especially Docker containers rely on sophisticated fs-level data abstraction with a number of read-only images which creates a template used for container initialization. When initialized a container include a writable layer where all file modifications are stored.

With Docker Plugin, the Bacula Enterprise will save the full container image including all read-only and writable layers into a single image archive.

It is not needed to install a Bacula File daemon in each container, so you can backup containers based on common image repository. The Bacula Docker Plugin will contact the Docker service to read and save the contents of any system image or container image using snapshots (default behavior) and dump them using the Docker API.

Bacula does not need to walk through the container file-system to open, read, close and stat files, so it consumes less resources on the Docker infrastructure than a standard file level backup.

The backup of a single container consists of the following steps:

  1. Save current container state to new image (container commit - snapshot).

  2. Execute docker utility and save data.

  3. Remove saved snapshot to free not needed resources.

Backups can be performed for container in any state (created, running or stopped).

Docker containers can be selected for backup individually or by using container name matching. Multiple containers may be selected for backup. If a selected container cannot be found, a single job error will be generated and the backup will proceed to the next container unless the backup job is configured to be aborted on error. If no containers match the name expression provided, the backup will proceed to the next parameter or finish successfully without backing up any containers.

Container backup can be performed using a mode which quiesce I/O operations during backup and allow to achieve a consistent backup with some possible downtime. The container will remain suspended during the backup commit phase and will resume once the commit operation finishes. It is also possible to commit container without quiesce I/O operations.

To see all the options, go to Docker: Configuration.

Go back to: Backup.