Home

Awesome

osixia/backup-manager

Docker Pulls Docker Stars

Latest release: 0.3.0 - Backup Manager 0.7.12.4 - Changelog | Docker Hub 

A docker image to run periodically backup-manager.

https://github.com/sukria/Backup-Manager

Quick start

# Run Backup Manager image
docker run --volume /host/data:/data-to-backup --detach osixia/backup-manager:0.3.0

Beginner Guide

Backup directory and data persistence

Backups are created by default in the directory /data/backup that has been declared as a volume, so your backup files are saved outside the container in a data volume.

For more information about docker data volume, please refer to :

https://docs.docker.com/userguide/dockervolumes/

Use your own Backup Manager config

This image comes with a backup manager config file that can be easily customized via environment variables for a quick bootstrap, but setting your own backup-manager.conf is possible. 2 options:

Fix docker mounted file problems

You may have some problems with mounted files on some systems. The startup script try to make some file adjustment and fix files owner and permissions, this can result in multiple errors. See Docker documentation.

To fix that run the container with --copy-service argument :

	docker run [your options] osixia/backup-manager:0.3.0 --copy-service

Debug

The container default log level is info. Available levels are: none, error, warning, info, debug and trace.

Example command to run the container in debug mode:

docker run --detach osixia/backup-manager:0.3.0 --loglevel debug

See all command line options:

docker run osixia/backup-manager:0.3.0 --help

Environment Variables

Environment variables defaults are set in image/environment/default.yaml

See how to set your own environment variables

Upload configuration:

Encryption configuration:

Incremental tarball configuration:

Pipe configuration:

You can add BACKUP_MANAGER_PIPE_COMMAND_1, BACKUP_MANAGER_PIPE_COMMAND_2... to implement other pipe command.

Examples: Archive a remote MySQL database through SSH:
BACKUP_MANAGER_PIPE_COMMAND_0: ssh host -c \\"mysqldump -ufoo -pbar base\\"
BACKUP_MANAGER_PIPE_NAME_0: base
BACKUP_MANAGER_PIPE_FILETYPE_0: sql
BACKUP_MANAGER_PIPE_COMPRESS_0: gzip
Archive a specific directory, on a remote server through SSH:
BACKUP_MANAGER_PIPE_COMMAND_1: ssh host -c \\"tar -c -z /home/user\\"
BACKUP_MANAGER_PIPE_NAME_1: host.home.user
BACKUP_MANAGER_PIPE_FILETYPE_1: tar.gz

More help: https://raw.githubusercontent.com/sukria/Backup-Manager/master/doc/user-guide.txt

Set your own environment variables

Use command line argument

Environment variables can be set by adding the --env argument in the command line, for example:

docker run --env BACKUP_MANAGER_TARBALL_DIRECTORIES="/home/billy" \
--detach osixia/backup-manager:0.3.0

Link environment file

For example if your environment file is in : /data/backup-manager/environment/my-env.yaml

docker run --volume /data/backup-manager/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
--detach osixia/backup-manager:0.3.0

Take care to link your environment file to /container/environment/XX-somedir (with XX < 99 so they will be processed before default environment files) and not directly to /container/environment because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).

Make your own image or extend this image

This is the best solution if you have a private registry. Please refer to the Advanced User Guide just below.

Advanced User Guide

Extend osixia/backup-manager:0.3.0 image

If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.

Dockerfile example:

FROM osixia/backup-manager:0.3.0
MAINTAINER Your Name <your@name.com>

ADD environment /container/environment/01-custom
ADD gpg-keys /container/service/gpg/assets
ADD my-backup-manager.conf /container/service/backup-manager/assets/backup-manager.conf

Make your own backup-manager image

Clone this project :

git clone https://github.com/osixia/docker-backup-manager
cd docker-backup-manager

Adapt Makefile, set your image NAME and VERSION, for example :

NAME = osixia/backup-manager
VERSION = 0.2.0

becomes :
NAME = billy-the-king/backup-manager
VERSION = 0.1.0

Add your custom keys, environment files, config ...

Build your image :

make build

Run your image :

docker run -d billy-the-king/backup-manager:0.1.0

Tests

We use Bats (Bash Automated Testing System) to test this image:

https://github.com/sstephenson/bats

Install Bats, and in this project directory run :

make test

Under the hood: osixia/light-baseimage

This image is based on osixia/light-baseimage. More info: https://github.com/osixia/docker-light-baseimage

Security

If you discover a security vulnerability within this docker image, please send an email to the Osixia! team at security@osixia.net. For minor vulnerabilities feel free to add an issue here on github.

Please include as many details as possible.

Changelog

Please refer to: CHANGELOG.md