Author: Simon Bennett, Contributors: Jorge Guerra, Bikram Gupta
Docker is an extremely popular tool in the developer community—according to the StackOverflow 2022 survey, it is the most widely used tool among professional developers. There are several factors that have contributed to Docker’s popularity, including that it provides a simple and efficient way to package and deploy applications. Additionally, Docker has a large and active community of users, which has helped to drive innovation and adoption. In this post, we’ll walk through what data you should be backing up when using Docker and how to use SnapShooter for Docker backups.
When running an application in Docker, there are 3 types of data that need to be protected.
Application modification is when you modify the container data at runtime. Protecting this type of data typically means that you’d back up the whole image and push it to the registry. However, you can optimize backups for application modification by configuring the application to use volumes for data storage.
Application configuration contains the description of your specific application. For example, when deploying an NGINX or a Wordpress application, you will need to configure the application when it starts. When running Docker on a single host, the recommended practice for production deployment is Docker Compose. Docker Compose allows you to define the application configuration in a YAML file. You can keep the Docker Compose configuration in a Git repo, and deploy on to any host. You get an identical application, whenever you run Docker Compose. However, if you have runtime data, that will be lost when you switch hosts and run Docker Compose again.
For storing the application data, there are several options. Refer to the diagram below from Docker documentation.
Out of these options, named volumes are considered a best practice for managing storage in Docker. Named volumes are persistent, shareable, and easy to manage across different hosts. They also provide a clear separation between data and containers, making it easier to manage and migrate data independently of the containers themselves.
We recommend backing up Docker volumes to build a robust data protection strategy. Docker Desktop provides an extension for backing up and restoring a volume. There are some other scenarios to be considered as well, which include:
In SnapShooter, we have recently added support for comprehensive backup/restore for Docker-based applications.
November 7, 2023•3 min read
October 23, 2023•3 min read
October 2, 2023•3 min read