From effacb00d5bbe48b093828ff8211316f1ea2054b Mon Sep 17 00:00:00 2001 From: Werner Beroux Date: Mon, 1 Feb 2016 12:05:09 +0100 Subject: [PATCH] Add .cache/duplicity as recommended mount point. --- Dockerfile | 4 +++- README.md | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fe73b52..528a247 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,13 @@ RUN apk add --update duplicity openssh openssl py-crypto py-pip rsync \ && rm /var/cache/apk/* \ && adduser -D -u 1896 duplicity \ && mkdir -p /home/duplicity/.cache/duplicity \ - && chmod go+rwx /home/duplicity/ + && mkdir -p /home/duplicity/.gnupg \ + && chmod -R go+rwx /home/duplicity/ ENV HOME=/home/duplicity VOLUME /home/duplicity/.cache/duplicity +VOLUME /home/duplicity/.gnupg USER duplicity diff --git a/README.md b/README.md index 78c139d..fc8d0b1 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Features of this Docker image: In general you'd want: * Set environment variable `PASSPHRASE`, unless you want to type it manually in the prompt (remember then to add `-it`). + * Mount `/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](http://duplicity.nongnu.org/duplicity.1.html#sect5)). * Mount `/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). * Mount what you want to backup or where you want to restore a backup. * May have to mount a few other files for authentication (see examples below). @@ -46,6 +47,7 @@ Now you're ready to perform a **backup**: $ docker run --rm --user $UID \ -e PASSPHRASE=P4ssw0rd \ + -v $PWD/.cache:/home/duplicity/.cache/duplicity \ -v $PWD/.gnupg:/home/duplicity/.gnupg \ -v ~/.boto:/home/duplicity/.boto:ro \ -v /:/data:ro \ @@ -80,6 +82,7 @@ Now you're ready to perform a **backup**: $ docker run --rm --user $UID \ -e PASSPHRASE=P4ssw0rd \ -e GOOGLE_DRIVE_ACCOUNT_KEY=$(cat pydriveprivatekey.pem) \ + -v $PWD/.cache:/home/duplicity/.cache/duplicity \ -v $PWD/.gnupg:/home/duplicity/.gnupg \ -v /:/data:ro \ wernight/duplicity \ @@ -96,6 +99,7 @@ Supposing you've an **SSH** access to some machine, you can: $ docker run --rm -it --user root \ -e PASSPHRASE=P4ssw0rd \ + -v $PWD/.cache:/home/duplicity/.cache/duplicity \ -v $PWD/.gnupg:/home/duplicity/.gnupg \ -v ~/.ssh/id_rsa:/id_rsa:ro \ -v ~/.ssh/known_hosts:/etc/ssh/ssh_known_hosts:ro \