-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
57 lines (48 loc) · 1.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# https://hub.docker.com/_/alpine
FROM alpine:3.19
ENV HOME=/home/duplicity
RUN set -x \
&& apk add --no-cache \
ca-certificates \
gettext \
gnupg \
lftp \
libffi \
librsync \
libxml2 \
libxslt \
openssh \
openssl \
poetry \
python3 \
py3-paramiko \
rsync \
&& update-ca-certificates
COPY pyproject.toml poetry.lock /
RUN set -x \
# Dependencies to build Python packages.
&& apk add --no-cache -t .build-deps \
gcc \
libffi-dev \
librsync-dev \
libxml2-dev \
libxslt-dev \
musl-dev \
openssl-dev \
python3-dev \
# Install Python dependencies.
&& poetry install \
# Clean up
&& apk del --purge .build-deps
RUN set -x \
# Run as non-root user.
&& adduser -D -u 1896 duplicity \
&& mkdir -p /home/duplicity/.cache/duplicity \
&& mkdir -p /home/duplicity/.gnupg \
&& chmod -R go+rwx /home/duplicity/
VOLUME ["/home/duplicity/.cache/duplicity", "/home/duplicity/.gnupg"]
USER duplicity
# Brief check that it works.
RUN poetry run duplicity --version
ENTRYPOINT ["poetry", "shell"]
CMD ["duplicity"]