[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> MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
ENV VERSION v1.1.0 WORKDIR /src
COPY . .
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 .
ENV CGO_ENABLED=0 ENV CGO_ENABLED=0
ENV BUILD_HOST=syncthing.net ENV BUILD_HOST=syncthing.net
ENV BUILD_USER=docker 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 FROM alpine
@ -20,17 +17,13 @@ VOLUME ["/var/syncthing"]
RUN apk add --no-cache ca-certificates su-exec 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 \ # HEALTHCHECK --interval=1m --timeout=10s \
# CMD nc -z localhost 8384 || exit 1 # CMD nc -z localhost 8384 || exit 1
ENTRYPOINT \ ENV STGUIADDRESS=0.0.0.0:8384
chown "${PUID}:${PGID}" /var/syncthing \ ENTRYPOINT ["/bin/entrypoint.sh", "/bin/syncthing", "-home", "/var/syncthing/config"]
&& su-exec "${PUID}:${PGID}" \
env HOME=/var/syncthing \
/bin/syncthing \
-home /var/syncthing/config \
-gui-address 0.0.0.0:8384