2023-03-14 18:32:14 +00:00
|
|
|
# FROM archlinux:latest
|
2023-03-14 18:35:07 +00:00
|
|
|
FROM alpine:latest AS base
|
2023-03-14 18:32:14 +00:00
|
|
|
|
|
|
|
# Install duplicity
|
|
|
|
# RUN pacman --noconfirm -Syu duplicity python-pip python-pydrive2
|
2023-03-15 08:19:27 +00:00
|
|
|
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
|
|
|
RUN \
|
|
|
|
apk add py3-pip python3-dev gcc libffi-dev musl-dev duplicity rust cargo git && \
|
|
|
|
pip install pydrive2 && \
|
|
|
|
apk del rust musl-dev libffi-dev gcc python3-dev cargo git
|
2023-03-14 18:32:14 +00:00
|
|
|
|
|
|
|
WORKDIR /var/lib/duplicity
|
|
|
|
ENV HOME="/var/lib/duplicity"
|
|
|
|
|
|
|
|
# Configure entrypoint and command
|
|
|
|
ENTRYPOINT ["crond", "-f", "-d", "5"]
|
|
|
|
CMD []
|
|
|
|
|
|
|
|
# Add image labels
|
2023-03-14 18:38:14 +00:00
|
|
|
LABEL org.opencontainers.image.title="backup-duplicity"
|
2023-03-14 18:32:14 +00:00
|
|
|
LABEL org.opencontainers.image.description="Backup solution for Docker volumes based on Duplicity"
|
|
|
|
LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
|
|
|
|
LABEL org.opencontainers.image.url="https://github.com/Steffo99/docker-backup-duplicity"
|
|
|
|
LABEL org.opencontainers.image.authors="Stefano Pigozzi <me@steffo.eu>"
|
|
|
|
|
|
|
|
# Add duplicity to cron
|
|
|
|
COPY ./backup.sh /etc/periodic/daily/backup.sh
|
|
|
|
|
|
|
|
# Configure duplicity
|
|
|
|
ENV DUPLICITY_FULL_IF_OLDER_THAN=1M
|
2023-03-14 18:35:07 +00:00
|
|
|
|
|
|
|
# Final!
|
2023-03-15 07:56:33 +00:00
|
|
|
FROM base AS final
|