diff --git a/Dockerfile.raspbian b/Dockerfile.raspbian index 7545f7c..64bbeec 100644 --- a/Dockerfile.raspbian +++ b/Dockerfile.raspbian @@ -44,8 +44,8 @@ ENV FULL_CRON_SCHEDULE="" ENV VERIFY_CRON_SCHEDULE="" ADD backup.sh / -ADD entrypoint.sh / ADD restore.sh / +ADD start.sh / ADD verify.sh / -ENTRYPOINT [ "/entrypoint.sh" ] +CMD [ "/start.sh" ] diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index d7c8529..05a030f 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -44,8 +44,8 @@ ENV FULL_CRON_SCHEDULE="" ENV VERIFY_CRON_SCHEDULE="" ADD backup.sh / -ADD entrypoint.sh / ADD restore.sh / +ADD start.sh / ADD verify.sh / -ENTRYPOINT [ "/entrypoint.sh" ] +CMD [ "/start.sh" ] diff --git a/Readme.md b/Readme.md index cbaf633..27e9c25 100644 --- a/Readme.md +++ b/Readme.md @@ -17,9 +17,9 @@ Mount any directories you'd like to back up as a volume and run |CRON_SCHEDULE| |If you want to periodic incremental backups on a schedule, provide it here. By default we just backup once and exit| |FLOCK_WAIT|60|Seconds to wait for a lock before skipping a backup| |FTP_PASSWORD| |Used to provide passwords for some backends. May not work without an attached TTY| -|FULL_CRON_SCHEDULE| |If you want to periodic full backups on a schedule, provide it here. This requires an incremental cron schedule too.| +|FULL_CRON_SCHEDULE| |If you want to periodic full backups on a schedule, provide it here. This requires an incremental cron schedule too| |GPG_KEY_ID| |The ID of the key you wish to use. See [Encryption](#encryption) section below| -|OPT_ARGUMENTS| |Any additional arguments to provide to the duplicity backup command. These can also be provided as additional arguments via the command line| +|OPT_ARGUMENTS| |Any additional arguments to provide to the duplicity backup command| |PASSPHRASE|Correct.Horse.Battery.Staple|Passphrase to use for GPG| |PATH_TO_BACKUP|/data|The path to the directory you wish to backup. If you want to backup multiple, see the [tip below](#backing-up-more-than-one-source-directory)| |RESTORE_ON_EMPTY_START| |Set this to "true" and if the `$PATH_TO_BACKUP` is empty, it will restore the latest backup. This can be used for auto recovery from lost data| @@ -27,7 +27,7 @@ Mount any directories you'd like to back up as a volume and run |VERIFY_CRON_SCHEDULE| |If you want to verify your backups on a schedule, provide it here| ## Encryption -Add a ro mount to your `~/.gnupg` directory and then provide the `GPG_KEY_ID` as an environment variable. The key will be used to sign and encrypt your files before sending to the backup destination. +By default Duplicity will use a symettric encryption using just your passphrase. If you wish to use a GPG key, you can add a ro mount to your `~/.gnupg` directory and then provide the `GPG_KEY_ID` as an environment variable. The key will be used to sign and encrypt your files before sending to the backup destination. Need to generate a key? Install `gnupg` and run `gnupg --gen-key` diff --git a/docker-compose.yaml b/docker-compose.yaml index 8f89d40..56b2c1f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,10 +1,12 @@ version: '2' services: duplicity: - build: . + build: + context: . + dockerfile: Dockerfile.ubuntu volumes: - - ~/my-backups:/backups - - ~/my-data:/data:ro + - ./my-backups:/backups + - ./my-data:/data:ro environment: PASSPHRASE: Correct.Horse.Battery.Staple CLEANUP_COMMAND: remove-older-than 5m diff --git a/entrypoint.sh b/start.sh similarity index 100% rename from entrypoint.sh rename to start.sh diff --git a/tests/test.sh b/tests/test.sh index 00af13f..af834be 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -45,7 +45,7 @@ else test -f /data/test.txt && exit 1 || echo "Gone" echo "Simulate a restart with RESTORE_ON_EMPTY_START..." - RESTORE_ON_EMPTY_START=true /entrypoint.sh + RESTORE_ON_EMPTY_START=true /start.sh echo "Verify restore happened..." test -f /data/test.txt