[UPD]Syncthing update

This commit is contained in:
Fabien BOURGEOIS 2020-01-27 06:23:48 +01:00
parent 6fb13aed2f
commit 9dafa4d498

View File

@ -1,16 +1,13 @@
FROM golang:1.11 AS builder
FROM golang:1.13 AS builder
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
ENV VERSION v1.1.0
RUN mkdir -p /usr/local/go/src/github.com/syncthing/syncthing
WORKDIR /usr/local/go/src/github.com/syncthing/syncthing
RUN git clone --branch "${VERSION}" --depth 1 https://github.com/syncthing/syncthing .
WORKDIR /src
COPY . .
ENV CGO_ENABLED=0
ENV BUILD_HOST=syncthing.net
ENV BUILD_USER=docker
RUN rm -f syncthing && go run build.go
RUN rm -f syncthing && go run build.go -no-upgrade build syncthing
FROM alpine
@ -20,17 +17,13 @@ VOLUME ["/var/syncthing"]
RUN apk add --no-cache ca-certificates su-exec
COPY --from=builder /usr/local/go/src/github.com/syncthing/syncthing/bin/syncthing /bin/syncthing
COPY --from=builder /src/syncthing /bin/syncthing
COPY --from=builder /src/script/docker-entrypoint.sh /bin/entrypoint.sh
ENV PUID=1000 PGID=1000
ENV PUID=1000 PGID=1000 HOME=/var/syncthing
# HEALTHCHECK --interval=1m --timeout=10s \
# CMD nc -z localhost 8384 || exit 1
ENTRYPOINT \
chown "${PUID}:${PGID}" /var/syncthing \
&& su-exec "${PUID}:${PGID}" \
env HOME=/var/syncthing \
/bin/syncthing \
-home /var/syncthing/config \
-gui-address 0.0.0.0:8384
ENV STGUIADDRESS=0.0.0.0:8384
ENTRYPOINT ["/bin/entrypoint.sh", "/bin/syncthing", "-home", "/var/syncthing/config"]