From 8e149bea0645ff60f0517c0668c32d1e4c46f69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 2 Mar 2022 18:41:47 +0100 Subject: [PATCH] bunch of renamings --- Dockerfile | 35 ++++++++++++++++++------------- libexec/kiwi-backup/build_command | 2 +- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc5d085..088f3ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,6 @@ LABEL maintainer="jmm@yavook.de" COPY requirements.txt /tmp/ RUN set -ex; \ - \ - # create backup source - mkdir -p /backup/source; \ \ # duplicity software dependencies apk --no-cache add \ @@ -59,22 +56,29 @@ RUN set -ex; \ ; \ apk del --purge .build-deps; \ rm -f "/tmp/requirements.txt"; \ - rm -rf "${HOME}/.cargo"; \ - \ - # create a non-root user - adduser -D -u 1368 duplicity; - -USER duplicity + rm -rf "${HOME}/.cargo"; RUN set -ex; \ \ - # confirm duplicity is working - duplicity --version; \ + # create /kiwi-backup directories tree + mkdir -m 777 /kiwi-backup; \ + mkdir -m 777 /kiwi-backup/source; \ + mkdir -m 777 /kiwi-backup/target; \ + \ + # create a non-root user + adduser -D -u 1368 kiwi-backup; + +USER kiwi-backup + +RUN set -ex; \ \ mkdir -p "${HOME}/.cache/duplicity"; \ - mkdir -pm 600 "${HOME}/.gnupg"; + mkdir -pm 700 "${HOME}/.gnupg"; \ + \ + # confirm duplicity is working + duplicity --version; -VOLUME [ "/home/duplicity/.cache/duplicity" ] +VOLUME [ "/home/kiwi-backup/.cache/duplicity" ] ENV \ ################# @@ -92,7 +96,8 @@ ENV \ SCHEDULE_RMFULL="36 05 * * SAT" \ SCHEDULE_RMINCR="36 05 * * SUN" \ BACKUP_VOLSIZE=1024 \ - BACKUP_TARGET="file:///backup/target" \ + BACKUP_SOURCE="/kiwi-backup/source" \ + BACKUP_TARGET="file:///kiwi-backup/target" \ OPTIONS_ALL="" \ OPTIONS_BACKUP="" \ OPTIONS_CLEANUP="" \ @@ -107,3 +112,5 @@ ENV \ COPY bin /usr/local/bin/ COPY libexec /usr/local/libexec/ + +CMD [ "kiwi-backup" ] diff --git a/libexec/kiwi-backup/build_command b/libexec/kiwi-backup/build_command index b5dc61a..7845d06 100755 --- a/libexec/kiwi-backup/build_command +++ b/libexec/kiwi-backup/build_command @@ -56,7 +56,7 @@ case "${task}" in printf ' --volsize %s' "${BACKUP_VOLSIZE}" printf ' --full-if-older-than %s' "${FULL_BACKUP_FREQUENCY}" printf '%s' "$( add_space "${OPTIONS_BACKUP}" )" - printf ' /backup/source' + printf ' %s' "${BACKUP_SOURCE}" ;; cleanup)