From 38c59b243631b3e427c47cccd3e8692e94dfbac3 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Wed, 4 Dec 2019 23:49:32 +0100 Subject: [PATCH] Use XDG_CACHE_HOME to control cache dir --- Dockerfile | 1 + docker-compose.yaml | 4 ++-- restic_compose_backup/restic.py | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e6a3b1..00ab72c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN apk update && apk add python3 dcron mariadb-client postgresql-client ADD . /restic-compose-backup WORKDIR /restic-compose-backup RUN pip3 install -U pip setuptools && pip3 install -e . +ENV XDG_CACHE_HOME=/cache ENTRYPOINT [] CMD ["./entrypoint.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index a818764..be56201 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,8 +9,8 @@ services: - /var/run/docker.sock:/tmp/docker.sock:ro # Map backup database locally - ./restic_data:/restic_data - - ./restic_cache:/restic_cache - # Map in project source + - ./restic_cache:/cache + # Map in project source in dev - .:/restic-compose-backup web: image: nginx diff --git a/restic_compose_backup/restic.py b/restic_compose_backup/restic.py index a574a84..938f995 100644 --- a/restic_compose_backup/restic.py +++ b/restic_compose_backup/restic.py @@ -97,8 +97,6 @@ def restic(repository: str, args: List[str]): """Generate restic command""" return [ "restic", - "--cache-dir", - "/restic_cache", "-r", repository, ] + args