• Stars
    star
    330
  • Rank 124,471 (Top 3 %)
  • Language
    Shell
  • License
    The Unlicense
  • Created about 4 years ago
  • Updated 4 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,172
star
2

node-docker-good-defaults

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

dogvscat

Sample Docker Swarm cluster stack of tools
HCL
494
star
4

nodejs-rocks-in-docker

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

docker-mastery-for-nodejs

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

php-docker-good-defaults

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

jekyll-serve

Jekyll in a Docker Container For Easy SSG Development
Dockerfile
327
star
8

awesome-swarm

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

kubernetes-mastery

Kubernetes course on Udemy from @BretFisher and @jpetazzo
Shell
229
star
10

docker-ci-automation

GitHub Actions automation examples with Docker's official actions
Shell
222
star
11

multi-platform-docker-build

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

compose-dev-tls

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

github-actions-templates

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

browncoat

Container for testing app failures in orchestrators. It aims to misbehave.
JavaScript
67
star
15

podspec

Kubernetes Pod Specification Good Defaults
65
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
39
star
18

super-linter-workflow

A Reusable Workflow of the Super-Linter GitHub Action
35
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
18
star
24

petclinic

sample dockerization of a Java Spring Boot app
Java
16
star
25

redis-tini

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

BretFisher

15
star
27

nodemongoapp

Docker Example Node + Mongo App
JavaScript
10
star
28

initcontainers

Kubernetes initContainers examples and good defaults
9
star
29

bret.run

Static files for easy gettin' stuff
Shell
7
star
30

PowerShell-Profile

Microsoft.PowerShell_profile.ps1
PowerShell
6
star
31

resume

My Resume, hopefully current.
HTML
5
star
32

completion-image

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

gitops-argocd

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

nodeBeginnerBookLearnings

Me just learning the node code from the Excellent
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

AutoSPInstaller-User-Creator

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

katacoda-scenarios

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

pmx-docker

Shell
1
star