Giter VIP home page Giter VIP logo

docker-vackup's Introduction

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 ......

docker-vackup's People

Contributors

bretfisher avatar ohnotnow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.