Browse Source

Switch from entrypoint to start command to allow exec of other scripts

ViViDboarder 9 months ago
parent
commit
947dc939f2
6 changed files with 13 additions and 11 deletions
  1. 2
    2
      Dockerfile.raspbian
  2. 2
    2
      Dockerfile.ubuntu
  3. 3
    3
      Readme.md
  4. 5
    3
      docker-compose.yaml
  5. 0
    0
      start.sh
  6. 1
    1
      tests/test.sh

+ 2
- 2
Dockerfile.raspbian View File

@@ -44,8 +44,8 @@ ENV FULL_CRON_SCHEDULE=""
44 44
 ENV VERIFY_CRON_SCHEDULE=""
45 45
 
46 46
 ADD backup.sh /
47
-ADD entrypoint.sh /
48 47
 ADD restore.sh /
48
+ADD start.sh /
49 49
 ADD verify.sh /
50 50
 
51
-ENTRYPOINT [ "/entrypoint.sh" ]
51
+CMD [ "/start.sh" ]

+ 2
- 2
Dockerfile.ubuntu View File

@@ -44,8 +44,8 @@ ENV FULL_CRON_SCHEDULE=""
44 44
 ENV VERIFY_CRON_SCHEDULE=""
45 45
 
46 46
 ADD backup.sh /
47
-ADD entrypoint.sh /
48 47
 ADD restore.sh /
48
+ADD start.sh /
49 49
 ADD verify.sh /
50 50
 
51
-ENTRYPOINT [ "/entrypoint.sh" ]
51
+CMD [ "/start.sh" ]

+ 3
- 3
Readme.md View File

@@ -17,9 +17,9 @@ Mount any directories you'd like to back up as a volume and run
17 17
 |CRON_SCHEDULE| |If you want to periodic incremental backups on a schedule, provide it here. By default we just backup once and exit|
18 18
 |FLOCK_WAIT|60|Seconds to wait for a lock before skipping a backup|
19 19
 |FTP_PASSWORD| |Used to provide passwords for some backends. May not work without an attached TTY|
20
-|FULL_CRON_SCHEDULE| |If you want to periodic full backups on a schedule, provide it here. This requires an incremental cron schedule too.|
20
+|FULL_CRON_SCHEDULE| |If you want to periodic full backups on a schedule, provide it here. This requires an incremental cron schedule too|
21 21
 |GPG_KEY_ID| |The ID of the key you wish to use. See [Encryption](#encryption) section below|
22
-|OPT_ARGUMENTS| |Any additional arguments to provide to the duplicity backup command. These can also be provided as additional arguments via the command line|
22
+|OPT_ARGUMENTS| |Any additional arguments to provide to the duplicity backup command|
23 23
 |PASSPHRASE|Correct.Horse.Battery.Staple|Passphrase to use for GPG|
24 24
 |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)|
25 25
 |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
27 27
 |VERIFY_CRON_SCHEDULE| |If you want to verify your backups on a schedule, provide it here|
28 28
 
29 29
 ## Encryption
30
-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.
30
+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.
31 31
 
32 32
 Need to generate a key? Install `gnupg` and run `gnupg --gen-key`
33 33
 

+ 5
- 3
docker-compose.yaml View File

@@ -1,10 +1,12 @@
1 1
 version: '2'
2 2
 services:
3 3
   duplicity:
4
-    build: .
4
+    build:
5
+      context: .
6
+      dockerfile: Dockerfile.ubuntu
5 7
     volumes:
6
-      - ~/my-backups:/backups
7
-      - ~/my-data:/data:ro
8
+      - ./my-backups:/backups
9
+      - ./my-data:/data:ro
8 10
     environment:
9 11
       PASSPHRASE: Correct.Horse.Battery.Staple
10 12
       CLEANUP_COMMAND: remove-older-than 5m

entrypoint.sh → start.sh View File


+ 1
- 1
tests/test.sh View File

@@ -45,7 +45,7 @@ else
45 45
     test -f /data/test.txt && exit 1 || echo "Gone"
46 46
 
47 47
     echo "Simulate a restart with RESTORE_ON_EMPTY_START..."
48
-    RESTORE_ON_EMPTY_START=true /entrypoint.sh
48
+    RESTORE_ON_EMPTY_START=true /start.sh
49 49
 
50 50
     echo "Verify restore happened..."
51 51
     test -f /data/test.txt

Loading…
Cancel
Save