-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (51 loc) · 1.89 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
FROM alpine:3.14
LABEL authors="nVentiveUX <https://github.com/nVentiveUX>"
LABEL license="MIT"
LABEL description="Docker image for syncthing installation. \
Think for ARM / x64 devices."
SHELL [ "/bin/ash", "-eo", "pipefail", "-c" ]
# User definition environment variables
ENV SYNCTHING_USER="syncthing" \
SYNCTHING_USER_UID=1000 \
SYNCTHING_GROUP="syncthing" \
SYNCTHING_GROUP_GID=1000 \
SYNCTHING_ADMIN_USER="admin" \
SYNCTHING_ADMIN_PASSWORD="admin"
ENV SYNCTHING_GPG_KEY1="49F5AEC0BCE524C7" \
SYNCTHING_GPG_KEY2="D26E6ED000654A3E" \
SYNCTHING_VERSION="1.28.1" \
SYNCTHING_ARCH="amd64"
RUN set -x \
&& apk add --no-cache \
bash \
coreutils \
py3-bcrypt \
py3-cryptography \
shadow \
su-exec \
&& apk add --no-cache --virtual .temp-deps \
gnupg \
openssl \
&& tarball="syncthing-linux-${SYNCTHING_ARCH}-v${SYNCTHING_VERSION}.tar.gz" \
&& wget --quiet \
"https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/$tarball" \
"https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/sha1sum.txt.asc" \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& gpg --keyserver pgp.cyberbits.eu --recv-keys "${SYNCTHING_GPG_KEY1}" "${SYNCTHING_GPG_KEY2}" \
&& gpg --batch --decrypt --output sha1sum.txt sha1sum.txt.asc \
&& grep -E " ${tarball}\$" sha1sum.txt | sha1sum -c - \
&& rm -rf "$GNUPGHOME" sha1sum.txt sha1sum.txt.asc \
&& dir="$(basename "$tarball" .tar.gz)" \
&& bin="$dir/syncthing" \
&& tar -xvzf "$tarball" "$bin" \
&& rm "$tarball" \
&& mv "$bin" /usr/local/bin/syncthing \
&& rmdir "$dir" \
&& apk del .temp-deps \
&& mkdir -p /etc/syncthing /var/lib/syncthing
COPY rootfs/ /
VOLUME ["/etc/syncthing", "/var/lib/syncthing"]
EXPOSE 8384/tcp 22000/tcp 22000/udp 21027/udp
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["syncthing", "-home=/etc/syncthing", "-logflags=0"]