-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
118 lines (110 loc) · 3.91 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# syntax=docker/dockerfile:1
FROM alpine:3.21
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILDPLATFORM
ARG BUILDOS
ARG BUILDARCH
ARG BUILDVARIANT
RUN set -eu; \
echo "TARGETPLATFORM=$TARGETPLATFORM"; \
echo "TARGETOS=$TARGETOS"; \
echo "TARGETARCH=$TARGETARCH"; \
echo "TARGETVARIANT=$TARGETVARIANT"; \
echo "BUILDPLATFORM=$BUILDPLATFORM"; \
echo "BUILDOS=$BUILDOS"; \
echo "BUILDARCH=$BUILDARCH"; \
echo "BUILDVARIANT=$BUILDVARIANT";
# Install isync
RUN apk add --no-cache ca-certificates
RUN set -eux; \
apk add --no-cache isync~1.5.0; \
# For mbsync-get-cert to get a self-signed certificate
apk add --no-cache openssl; \
mbsync --version
# Install restic
RUN set -eux; \
RESTIC_VERSION=v0.15.2; \
case "$( uname -m )" in \
'x86') \
URL="https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_linux_386.bz2"; \
SHA256=9245cafed0bc3f0531950cb8f31e3b7c2711a2785c79ec088d554bb8fe16ae81; \
;; \
'x86_64') \
URL="https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_linux_amd64.bz2"; \
SHA256=44ce3367b0b413ad48757de8e2a1f4e2c30137e7cdc77db64906f3eb7087b78f; \
;; \
'armv7l') \
URL="https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_linux_arm.bz2"; \
SHA256=3a379eedcb90ad0ec60a24c89f9892eb7a12ddb8a28045e432fc2c43e7faa186; \
;; \
'aarch64') \
URL="https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_linux_arm64.bz2"; \
SHA256=1f9d03503d8756311b7904e99aee3460f1ace427aad88f6dcba6a97a9c5a8171; \
;; \
*) \
echo "Architecture not supported"; \
exit 1; \
;; \
esac; \
FILE=restic.bz2; \
wget -q "$URL" -O "$FILE"; \
echo "$SHA256 $FILE" | sha256sum -c -; \
bzip2 -d "$FILE"; \
mkdir -pv /usr/local/bin; \
mv -v restic /usr/local/bin/restic; \
chmod +x /usr/local/bin/restic; \
restic version; \
:
# Install pingme
RUN set -eux; \
PINGME_VERSION=v0.2.6; \
case "$( uname -m )" in \
'x86') \
URL="https://github.com/kha7iq/pingme/releases/download/v0.2.6/pingme_Linux_x86_64.tar.gz"; \
SHA256=747e05242f4d1448f2bb7d5cc8903683ec75fa94fa95f2ec1704b0a880a7b9e9; \
;; \
'x86_64') \
URL="https://github.com/kha7iq/pingme/releases/download/v0.2.6/pingme_Linux_x86_64.tar.gz"; \
SHA256=2f224389804b433318adaa5b5a4debe9974d8f17a03d2909e4c651cb723a4bed; \
;; \
'armv7l') \
URL="https://github.com/kha7iq/pingme/releases/download/v0.2.6/pingme_Linux_arm.tar.gz"; \
SHA256=7feeac9c9a0c353da2a03f0e3eb67aab6bc4a31248c0f3c694a80f15156804d9; \
;; \
'aarch64') \
URL="https://github.com/kha7iq/pingme/releases/download/v0.2.6/pingme_Linux_arm64.tar.gz"; \
SHA256=06ead384717a718366d032c11b223ec5285705623c9507a8e3432bc7e4cd6e89; \
;; \
*) \
echo "Architecture not supported"; \
exit 1; \
;; \
esac; \
FILE=pingme.tar.gz; \
wget -q "$URL" -O "$FILE"; \
echo "$SHA256 $FILE" | sha256sum -c -; \
tar -xvf "$FILE" --no-same-owner --no-same-permissions -- pingme LICENSE.md; \
rm -f "$FILE"; \
mkdir -pv /usr/local/bin; \
mv -v pingme /usr/local/bin/pingme; \
chmod +x /usr/local/bin/pingme; \
pingme --version; \
mkdir -p /licenses; \
mv -v LICENSE.md /licenses/LICENSE.md; \
:
# Install notification tools
RUN apk add --no-cache curl jq
# Install copy tools
RUN apk add --no-cache rsync
# Install helper scripts
COPY sync /sync
RUN chmod +x /sync
WORKDIR /mail
VOLUME /mail
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "/sync" ]