1
0
Fork 0
mirror of https://github.com/yavook/kiwi-backup.git synced 2024-11-21 22:43:01 +00:00
kiwi-backup/Dockerfile

110 lines
2.4 KiB
Docker
Raw Normal View History

2021-09-21 16:56:49 +00:00
FROM python:3.9-alpine3.13
2020-08-26 23:30:14 +00:00
LABEL maintainer="jmm@yavook.de"
# Previous work: https://github.com/wernight/docker-duplicity
RUN set -ex; \
2020-08-27 14:53:19 +00:00
\
# create backup source
mkdir -p /backup/source; \
2020-08-26 23:30:14 +00:00
\
2021-09-21 16:39:14 +00:00
apk --no-cache add \
2020-08-26 23:30:14 +00:00
ca-certificates \
gettext \
gnupg \
lftp \
libffi \
librsync \
libxml2 \
libxslt \
2021-09-21 16:39:14 +00:00
openssh-client \
2020-08-26 23:30:14 +00:00
openssl \
rsync \
; \
update-ca-certificates; \
\
# dependencies to build python packages
2021-09-21 16:39:14 +00:00
apk --no-cache add --virtual .build-deps \
2020-08-26 23:30:14 +00:00
gcc \
libffi-dev \
librsync-dev \
libxml2-dev \
libxslt-dev \
make \
musl-dev \
openssl-dev \
; \
\
# make use of "wheel" python packages
2021-09-21 16:39:14 +00:00
pip3 --no-cache-dir install wheel ; \
2020-08-26 23:30:14 +00:00
\
2021-09-21 16:39:14 +00:00
pip3 --no-cache-dir install \
2020-08-26 23:30:14 +00:00
# main app
duplicity \
\
# general duplicity requirements, based on
# http://duplicity.nongnu.org/vers8/README
# https://git.launchpad.net/duplicity/tree/requirements.txt
fasteners \
future \
mock \
paramiko \
python-gettext \
requests \
urllib3 \
\
# backend requirements
azure-mgmt-storage \
b2sdk \
boto \
boto3 \
dropbox \
gdata \
jottalib \
mediafire \
mega.py \
pydrive \
pyrax \
python-swiftclient \
requests_oauthlib \
; \
\
# remove buildtime dependencies
2021-09-21 16:39:14 +00:00
pip3 --no-cache-dir uninstall -y wheel; \
2020-08-26 23:30:14 +00:00
apk del --purge .build-deps
2020-08-28 01:22:05 +00:00
VOLUME ["/root/.cache/duplicity", "/backup/target"]
2020-08-26 23:30:14 +00:00
ENV \
#################
# BACKUP POLICY #
#################
2020-08-28 01:22:05 +00:00
SCHEDULE_BACKUP="36 02 * * *" \
SCHEDULE_CLEANUP="36 04 * * *" \
2020-08-28 01:22:05 +00:00
FULL_BACKUP_FREQUENCY=3M \
BACKUP_RETENTION_TIME=6M \
KEEP_NUM_FULL_CHAINS=2 \
\
######################
# ADDITIONAL OPTIONS #
######################
SCHEDULE_RMFULL="36 05 * * SAT" \
SCHEDULE_RMINCR="36 05 * * SUN" \
BACKUP_VOLSIZE=1024 \
2020-08-28 01:22:05 +00:00
BACKUP_TARGET="file:///backup/target" \
OPTIONS_ALL="" \
OPTIONS_BACKUP="" \
OPTIONS_CLEANUP="" \
OPTIONS_RMFULL="" \
2020-08-27 14:53:19 +00:00
OPTIONS_RMINCR="" \
\
##############
# ENCRYPTION #
##############
GPG_KEY_ID="" \
GPG_PASSPHRASE=""
2020-08-28 09:38:42 +00:00
COPY do-plicity /usr/local/bin/
2020-08-26 23:30:14 +00:00
CMD ["do-plicity"]