Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

vbackup

The docker export and docker commit commands do not save the container volumes. Use this script to save and load the container volumes.

Usage

vbackup [-v|--verbose] <subcommand> <subcommand-arguments>

Podman

To use Podman instead of Docker, set the VBACKUP_RUNTIME environment variable to podman like so:

VBACKUP_RUNTIME=podman vbackup ...

Examples

Let's migrate a container to another host along with all its volumes.

# Stop the container
❯ docker stop $CONTAINER
# Create a new image
❯ docker commit $CONTAINER $CONTAINER
# Transfer the image to another host
❯ docker save $CONTAINER | ssh $USER@$HOST docker load
# Save the volumes (using .tar.gz extension to enable compression)
❯ vbackup export-all $CONTAINER $CONTAINER-volumes.tar.gz
# Copy volumes to other host
❯ scp $CONTAINER-volumes.tar.gz $USER@$HOST:~/

## On the other host

# Create the new container with the same options used when creating the
# previous one
❯ docker create --name $CONTAINER [<previous-container-options>] $CONTAINER
# Load the volumes
❯ vbackup import-all $CONTAINER $CONTAINER-volumes.tar.gz
# Start the container
❯ docker start $CONTAINER

About

Container volume backup & restoration utility

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages