To run a one time backup, mount the volume you would like to see backed up into a container and run the backup command: path/to/local_backups:/archive volumes: # You can omit this if you do not want to keep local backups. You can override the # location inside of the container by setting `BACKUP_ARCHIVE`. var/run/docker.sock:/var/run/docker.sock:ro # If you mount a local directory or volume to `/archive` a local # copy of the backup will be stored there. In case you need to proxy the socket, you can # also provide a location by setting `DOCKER_HOST` in the container You can omit this if you don't want # to stop the container. data:/backup/my-app-backup:ro # Mounting the Docker socket allows the script to stop and restart # the container during backup. backup.env # see below for configuration reference volumes: image: offen/docker-volume-backup:latest restart: always env_file. # Check # for a list of available releases. # In production, it is advised to lock your image tag to a proper # release version instead of using `latest`. docker-volume-backup.stop-during-backup=true backup: You can omit this label if stopping during backup # not required. # This means the container will be stopped during backup to ensure # backup integrity. Quickstart Recurring backups in a compose setupĪdd a backup service to your compose setup and mount the volumes you would like to see backed up: Differences to futurice/docker-volume-backupĬode and documentation for v1 versions are found on this branch.Running multiple instances in the same setup.Rotating away backups that are older than 7 days.Backing up to AWS S3 as well as locally.Backing up to MinIO (using Docker secrets).Handle file uploads using third party tools.Use special characters in notification URLs.Run multiple backup schedules in the same container.Replace deprecated exec-pre and exec-post labels.Replace deprecated BACKUP_FROM_SNAPSHOT usage.Run custom commands during the backup lifecycle.Send email notifications on failed backup runs.It also supports encrypting your backups using GPG and sending notifications for failed backup runs. It handles recurring or one-off backups of Docker volumes to a local directory, any S3, WebDAV, Azure Blob Storage, Dropbox or SSH compatible storage (or any combination) and rotates away old backups if configured. The offen/docker-volume-backup Docker image can be used as a lightweight (below 15MB) sidecar container to an existing Docker setup. The depends_on option is ignored when deploying a stack in swarm mode with a version 3 Compose file.Backup Docker volumes locally or to any S3, WebDAV, Azure Blob Storage, Dropbox or SSH compatible storage. I don't know which container will run first (although I expect it executes from top to bottom) however you can force an order with depends_on as shown here In case the volume is empty and both containers have data in the target directory the first container to be run will mount its data into the volume and the other container will see that data (and not its own). However you can find out the actual location of the file by “docker volume inspect ”. They don’t have a docker command to backup / export a named volume. If you create another container binds to an existing named volume, no files from the new image/container will be copied/overwritten, it will use the existing data inside the named volume. If you create a named volume by running a new container from image by docker run -v my-precious-data:/data imageName, the data within the image/container under /data will be copied into the named volume. This behaves the following way according to this source Listing data-volume: under the top-level volumes: key creates a named volume on the host if it doesn't exist yet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |