This repository was archived by the owner on Sep 5, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 1.27 KB
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
ARG BASE_IMAGE=docker.io/alpine:3.18.3
# ----------------------------------------
# Download and extract Syncthing binary
# ----------------------------------------
FROM ${BASE_IMAGE} as base
ARG ST_VERSION=1.23.7
ARG TARBALL_URL=https://github.com/syncthing/syncthing/releases/download/v${ST_VERSION}/syncthing-linux-386-v${ST_VERSION}.tar.gz
RUN apk add --no-cache ca-certificates tar tzdata wget
RUN wget --quiet --output-document - ${TARBALL_URL} | tar --extract --gzip --strip-components=1 \
--directory /usr/local/bin syncthing-linux-386-v${ST_VERSION}/syncthing
# ----------------------------------------
# Build the image from the 'base' image
# ----------------------------------------
FROM ${BASE_IMAGE}
LABEL maintainer="Chris Kankiewicz <Chris@ChrisKankiewicz.com>"
ENV STGUIADDRESS 0.0.0.0:8384
ENV STHOMEDIR /etc/syncthing
ENV STNODEFAULTFOLDER true
ENV STNORESTART true
ENV STNOUPGRADE true
EXPOSE 8384 22000/tcp 22000/udp 21027/udp
RUN adduser -DHs /sbin/nologin syncthing
RUN mkdir -p /etc/syncthing /vol/storage && chown -R syncthing:syncthing /etc/syncthing /vol/storage
RUN apk add --no-cache ca-certificates tzdata
COPY --from=base /usr/local/bin/syncthing /usr/local/bin/syncthing
USER syncthing
VOLUME /etc/syncthing /vol/storage
CMD ["syncthing", "--no-browser"]