Sign inSign up

quentin96/duplicity-s3

By quentin96

•Updated about 5 years ago

Duplicity with s3 drivers in a container

Image
0

1.4K

quentin96/duplicity-s3 repository overview

⁠Duplicity with S3 drivers

Duplicity with s3 drivers in a container.

This docker image enable user to use duplicity in a docker image.

⁠Usage

In general, you:

  • MUST mount what you want to backup or restore in /data
  • MUST mount you .gnupg to be able to encrypt/decrypt your backups
  • SHOULD set you docker user id and group using -u option
  • SHOULD set AWS_ACCESS_KEY_ID to let duplicity connect to you S3 bucket
  • SHOULD set AWS_SECRET_ACCESS_KEY to let duplicity connect to you S3 bucket
  • SHOULD set PASSPHRASE to let duplicity be able to access to your GPG key

In addition to all standard duplicity environment variable⁠, you use:

environment variable namedescriptiondefault value
DUPLICITY_ACTIONAction to perform. More infos⁠incr
S3_BUCKETName of the S3 bucket to interact withNone
S3_ENDPOINT_URLURL of the S3 endpointNone
DUPLICITY_GPG_KEY_IDGPG key ID use to encrypt/decrypt/sign backupsNone
DUPLICITY_RESTORED_PATHSubfolder where duplicity will restore filesNone. Restore will be in the current folder
DUPLICITY_REMOVE_ALLNumber of backup to keep. More infos⁠None
DUPLICITY_OLDER_THANNumber of days to keep backup. More infos⁠None
DUPLICITY_FULL_IF_OLDER_THANMake a full backup when last full backup is older than6M

⁠Standard usage

⁠Backup
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd):/data \
  -v ${HOME}/.gnupg:/.gnupg \
  -e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
  -e AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxx \
  -e PASSPHRASE=mysecurepassphrase \
  -e S3_BUCKET=mys3bucket/subfolder/subsubfolder \
  -e S3_ENDPOINT_URL='https://s3.wasabisys.com' \
  -e DUPLICITY_GPG_KEY_ID=AAAAAAAAAAAAA \
  -e DUPLICITY_ACTION=incr \
 quentin96/duplicity-s3:latest
⁠Restore
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd):/data \
  -v ${HOME}/.gnupg:/.gnupg \
  -e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
  -e AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxx \
  -e PASSPHRASE=mysecurepassphrase \
  -e S3_BUCKET=mys3bucket/subfolder/subsubfolder \
  -e S3_ENDPOINT_URL='https://s3.wasabisys.com' \
  -e DUPLICITY_GPG_KEY_ID=AAAAAAAAAAAAA \
  -e DUPLICITY_ACTION=restore \
 quentin96/duplicity-s3:latest
⁠Backup collection status
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd):/data \
  -v ${HOME}/.gnupg:/.gnupg \
  -e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
  -e AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxx \
  -e PASSPHRASE=mysecurepassphrase \
  -e S3_BUCKET=mys3bucket/subfolder/subsubfolder \
  -e S3_ENDPOINT_URL='https://s3.wasabisys.com' \
  -e DUPLICITY_GPG_KEY_ID=AAAAAAAAAAAAA \
  -e DUPLICITY_ACTION=collection-status \
 quentin96/duplicity-s3:latest
⁠List files of backup 3 days ago
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd):/data \
  -v ${HOME}/.gnupg:/.gnupg \
  -e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
  -e AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxx \
  -e PASSPHRASE=mysecurepassphrase \
  -e S3_BUCKET=mys3bucket/subfolder/subsubfolder \
  -e S3_ENDPOINT_URL='https://s3.wasabisys.com' \
  -e DUPLICITY_GPG_KEY_ID=AAAAAAAAAAAAA \
  -e DUPLICITY_ACTION=list-current-files \
 quentin96/duplicity-s3:latest \
  --time 3D
⁠Restore in restored subfolder
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd):/data \
  -v ${HOME}/.gnupg:/.gnupg \
  -e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
  -e AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxx \
  -e PASSPHRASE=mysecurepassphrase \
  -e S3_BUCKET=mys3bucket/subfolder/subsubfolder \
  -e S3_ENDPOINT_URL='https://s3.wasabisys.com' \
  -e DUPLICITY_GPG_KEY_ID=AAAAAAAAAAAAA \
  -e DUPLICITY_ACTION=collection-status \
  -e DUPLICITY_RESTORED_PATH=/restored \
 quentin96/duplicity-s3:latest \
⁠Keep last 5 backups
docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd):/data \
  -v ${HOME}/.gnupg:/.gnupg \
  -e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
  -e AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxx \
  -e PASSPHRASE=mysecurepassphrase \
  -e S3_BUCKET=mys3bucket/subfolder/subsubfolder \
  -e S3_ENDPOINT_URL='https://s3.wasabisys.com' \
  -e DUPLICITY_GPG_KEY_ID=AAAAAAAAAAAAA \
  -e DUPLICITY_ACTION=collection-status \
  -e DUPLICITY_REMOVE_ALL=5 \
 quentin96/duplicity-s3:latest \

⁠Note

All folder with .nobackup file will be ignored

⁠Labels

We set labels on our images with additional information on the image. we follow the guidelines defined at http://label-schema.org/⁠. Visit their website for more information about those labels.

Tag summary

Content type

Image

Digest

Size

37.4 MB

Last updated

about 5 years ago

docker pull quentin96/duplicity-s3