Dockerfile linksduplicity backup tool.
Features of this Docker image:
1896), and meant to run as any user.For the general command-line syntax, do:
$ docker run --rm kcinnayste/duplicity --help
In general you...
/home/duplicity/.cache/duplicity as writable somewhere (if not cached, duplicity will have to recreate it from the remote repository which may require decrypting the backup contents). Note it may be quite large and contains metadata info about files you've backed up in clear text./home/duplicity/.gnupg as writable somewhere (that directory is used to validate incremental backups and shouldn't be necessary to restore your backup if you follows steps below).--allow-source-mismatch because Docker has a random host for each container.PASSPHRASE, unless you want to type it manually in the prompt (remember then to add -it).Example of commands you may want to run periodically to back up with good clean-up/maintenance (see below for various storage options):
$ docker run --rm ... kcinnayste/duplicity --full-if-older-than=6M source_directory target_url
$ docker run --rm ... kcinnayste/duplicity remove-older-than 6M --force target_url
$ docker run --rm ... kcinnayste/duplicity cleanup --force target_url
This would do:
at the first, you have to generate the SSH-Keys and add the Target to the known_hosts.
$ docker run --rm -it \
-v $PWD/sshParams/known_hosts:/home/duplicity/.ssh \
kcinnayste/duplicity \
--add-known-host example.com \
--generate-ssh-key
Supposing you've an SSH access to some machine, you can:
$ docker run --rm -it \
-e PASSPHRASE=P4ssw0rd \
-v $PWD/.cache:/home/duplicity/.cache/duplicity \
-v $PWD/.gnupg:/home/duplicity/.gnupg \
-v $PWD/sshParams/known_hosts:/home/duplicity/.ssh \
-v /:/data:ro \
kcinnayste/duplicity \
--full-if-older-than=6M --allow-source-mismatch \
--rsync-options='-e "ssh -i /id_rsa"' \
/data scp://[email protected]//some_dir
Here is a simple alias that should work in most cases:
$ alias duplicity='docker run --rm --user=root -v ~/.ssh/id_rsa:/home/duplicity/.ssh/id_rsa:ro -v ~/.boto:/home/duplicity/.boto:ro -v ~/.gnupg:/home/duplicity/.gnupg -v /:/mnt:ro -e PASSPHRASE=$PASSPHRASE wernight/duplicity duplicity $@'
Now you should be able to run duplicity almost as if it were installed, example:
$ PASSPHRASE=123456 duplicity --progress /mnt rsync://[email protected]/some_dir
Content type
Image
Digest
Size
51.4 MB
Last updated
over 7 years ago
docker pull kcinnayste/duplicity