• Stars
    star
    362
  • Rank 117,671 (Top 3 %)
  • Language
    Shell
  • License
    The Unlicense
  • Created over 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Script to easily backup and restore docker volumes

Vackup: Backup and Restore Docker Volumes

Lint Code Base

This is now an Official Docker Desktop Extension called "Volumes Backup & Share" which has more features, but I'll keep this repo around for historial purposes.

Vackup: (contraction of "volume backup")

Easily backup and restore Docker volumes using either tarballs or container images. It's designed for running from any host/container where you have the docker CLI.

Note that for open files like databases, it's usually better to use their preferred backup tool to create a backup file, but if you stored that file on a Docker volume, this could still be a way you get the Docker volume into a image or tarball for moving to remote storage for safe keeping.

export/import commands copy files between a local tarball and a volume. For making volume backups and restores.

save/load commands copy files between an image and a volume. For when you want to use image registries as a way to push/pull volume data.

Usage:

vackup export VOLUME FILE Creates a gzip'ed tarball in current directory from a volume

vackup import FILE VOLUME Extracts a gzip'ed tarball into a volume

vackup save VOLUME IMAGE Copies the volume contents to a busybox image in the /volume-data directory

vackup load IMAGE VOLUME Copies /volume-data contents from an image to a volume

Install

Download the vackup file in this repository to your local machine in your shell path and make it executable.

curl -sSL https://raw.githubusercontent.com/BretFisher/docker-vackup/main/vackup > /usr/local/bin/vackup
chmod +x /usr/local/bin/vackup

Error conditions

If any of the commands fail, the script will check to see if a VACKUP_FAILURE_SCRIPT environment variable is set. If so it will run it and pass the line number the error happened on and the exit code from the failed command. Eg,

# /opt/bin/vackup-failed.sh
LINE_NUMBER=$1
EXIT_CODE=$2
send_slack_webhook "Vackup failed on line number ${LINE_NUMBER} with exit code ${EXIT_CODE}!"
export VACKUP_FAILURE_SCRIPT=/opt/bin/vackup-failed.sh
./vackup export ......

More Repositories

1

udemy-docker-mastery

Docker Mastery Udemy course to build, compose, deploy, and manage containers from local development to high-availability in the cloud
JavaScript
5,263
star
2

node-docker-good-defaults

sample node app for Docker examples
JavaScript
2,323
star
3

dogvscat

Sample Docker Swarm cluster stack of tools
HCL
504
star
4

nodejs-rocks-in-docker

DockerCon "Docker for Node.js" examples
Dockerfile
494
star
5

docker-mastery-for-nodejs

Docker Mastery for Node.js Projects, From a Docker Captain
JavaScript
412
star
6

awesome-swarm

All the awesome tools, docs, and training on Docker and Mirantis Swarm Mode (SwarmKit)
385
star
7

php-docker-good-defaults

*WORK IN PROGRESS* sample PHP/Laravel app for Docker examples
Dockerfile
362
star
8

jekyll-serve

Jekyll in a Docker Container For Easy SSG Development
Dockerfile
336
star
9

docker-ci-automation

GitHub Actions automation examples with Docker's official actions
Shell
247
star
10

kubernetes-mastery

Kubernetes course on Udemy from @BretFisher and @jpetazzo
Shell
233
star
11

multi-platform-docker-build

Using BuildKit and TARGETPLATFORM for cross-platform Dockerfiles
Dockerfile
125
star
12

compose-dev-tls

Easy Traefik TLS proxy plus certificate generation for Docker Compose local development use
Shell
111
star
13

github-actions-templates

Reusable GitHub Actions workflow examples for cloud native DevOps
Dockerfile
75
star
14

podspec

Kubernetes Pod Specification Good Defaults
71
star
15

browncoat

Container for testing app failures in orchestrators. It aims to misbehave.
JavaScript
69
star
16

httping-docker

Ping with HTTP requests, built directly from master
C
52
star
17

docker-build-workflow

A Reusable Workflow of the Docker GitHub Actions
Dockerfile
42
star
18

super-linter-workflow

A Reusable Workflow of the Super-Linter GitHub Action
37
star
19

gha-runners

Terraform to create GitHub Action self-hosted runners in EC2 using ASG
HCL
29
star
20

slack-signup

Slack Team Access Request Form in Meteor
JavaScript
27
star
21

container-security-steps

Docker and Kubernetes security steps to help you create, build, test, and run safer in containers
26
star
22

stress

Docker images for stressing cpu and memory
Dockerfile
25
star
23

sysbench-docker-hpe

Sysbench Dockerfiles and Scripts for VM and Container benchmarking MySQL
Shell
19
star
24

BretFisher

18
star
25

petclinic

sample dockerization of a Java Spring Boot app
Java
17
star
26

redis-tini

Docker image of official redis with tini added for liveness healthchecks that reap zombies
Dockerfile
17
star
27

nodemongoapp

Docker Example Node + Mongo App
JavaScript
11
star
28

initcontainers

Kubernetes initContainers examples and good defaults
10
star
29

bret.run

Static files for easy gettin' stuff
Shell
7
star
30

PowerShell-Profile

Microsoft.PowerShell_profile.ps1
PowerShell
7
star
31

resume

My Resume, hopefully current.
HTML
5
star
32

gitops-argocd

4
star
33

completion-image

Generates completion certificates (images) for students based on a template image and a CSV file containing student names.
Go
3
star
34

wordsmith-k8s

Manifests for Docker's wordsmith demo
3
star
35

cheese

Simple web servers of cheese for yummy demos.
HTML
3
star
36

docker-github-actions-monorepo-example

3
star
37

slide-to-image

JavaScript
1
star
38

.github

1
star
39

dotfiles

My public dotfiles for Codespaces and examples
Shell
1
star
40

gatsby-starter-netlify-cms

JavaScript
1
star
41

nodeBeginnerBookLearnings

Me just learning the node code from the Excellent
1
star
42

AutoSPInstaller-User-Creator

I use this PowerShell Script with www.autospinstaller.com to automate (most) of a SharePoint 2010 deployment
PowerShell
1
star
43

katacoda-scenarios

https://www.katacoda.com/bretfisher
1
star
44

pmx-docker

Shell
1
star