Get started Bring yourself up to speed with our introductory content.

How do you perform Docker backup?

Few backup software providers offer Docker container backup support, but is there a way to back up Docker containers with any backup software?

There are backup vendors, such as Asigra, that specifically address Docker containers. However, I suspect it will be a while before native support for Docker backup and recovery becomes a universal feature.

That is because Docker can be backed up without the need for any specialized software. The company's website explains how to back up a Docker container using the following command:

$ sudo docker run --volumes-from dbdata -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata

This command launches a new container and mounts the volume from the dbdata container. It then mounts a local directory /backup and backs up the contents of the dbdata volume to a .TAR file within the /backup directory.

Although some might argue this is a somewhat primitive form of Docker backup, the command listed on the website can be used as a starting point rather than a complete backup solution. For example, an administrator might configure the system to run a similar command on a scheduled basis and then use their existing backup application to back up the resulting .TAR file.

More backup vendors might add native support for Docker in the future. I think a Docker-specific feature would probably be relatively easy for backup vendors to create. Even so, I don’t think we will see widespread implementation of such features until Docker adoption reaches critical mass.

Next Steps

The advantages of using Docker with virtualization

Will Docker make virtual machines obsolete?

Veritas NetBackup adds container backup

Dig Deeper on Backup and recovery software

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

How are you performing Docker backup?
Yeah, and it's going to be harder for Docker to get critical mass if an enterprise feels (in other words, their perception, regardless of whether it conforms with reality) that it can't provide robust availability. You'd think they'd have figured this out and included it in the beginning.

If you like entering arcane operators from the command line, you’ll love these manual container backup techniques. Keep in mind, there’s a faster and more efficient way to backup containers that’s just as effective. I've written instructions here:

Step 1: Add a Docker Host to Any Cloud As explained in a tutorial on the Morpheus support site, you can add a Docker host to the cloud of your choice in a matter of seconds. Start by choosing Infrastructure on the main Morpheus navigation bar. Select Hosts at the top of the Infrastructure window, and click the “+Container Hosts” button at the top right.

To back up a Docker host to a cloud via Morpheus, navigate to the Infrastructure screen and open the “+Container Hosts” menu.

Choose a container host type on the menu, select a group, and then enter data in the five fields: Name, Description, Visibility, Select a Cloud and Enter Tags (optional). Click Next, and then configure the host options by choosing a service plan. Note that the Volume, Memory, and CPU count fields will be visible only if the plan you select has custom options enabled.

Here is where you add and size volumes, set memory size and CPU count, and choose a network. You can also configure the OS username and password, the domain name, and the hostname, which by default is the container name you entered previously. Click Next, and then add any Automation Workflows (optional).Finally, review your settings and click Complete to save them.

Step 2: Add Docker Registry Integration to Public or Private Clouds Adam Hicks describes in another Morpheus tutorial how simple it is to integrate with a private Docker Registry. (No added configuration is required to use Morpheus to provision images with Docker’s public hub using the public Docker API.)

Select Integrations under the Admin tab of the main navigation bar, and then choose the “+New Integration” button on the right side of the screen. In the Integration window that appears, select Docker Repository in the Type drop-down menu, enter a name and add the private registry API endpoint. Supply a username and password for the registry you’re using, and click the Save Changes button.

Integrate a Docker Registry with a private cloud via the Morpheus “New Integration” dialog box.

To provision the integration you just created, choose Docker under Type in the Create Instance dialog, select the registry in the Docker Registry drop-down menu under the Configure tab, and then continue provisioning as you would any Docker container.

Step 3: Manage Backups Once you’ve added the Docker host and integrated the registry, a backup will be configured and performed automatically for each instance you provision. Morpheus support provides instructions for viewing backups, creating an instance backup, and creating a server backup.