2018-03-24 08:21:22 +00:00
|
|
|
FROM golang:1.10 AS builder
|
2018-02-04 21:43:14 +00:00
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/syncthing/syncthing
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
ENV BUILD_HOST=syncthing.net
|
|
|
|
ENV BUILD_USER=docker
|
|
|
|
RUN rm -f syncthing && go run build.go build syncthing
|
|
|
|
|
|
|
|
FROM alpine
|
|
|
|
|
2018-05-05 08:28:19 +00:00
|
|
|
EXPOSE 8384 22000 21027/udp
|
|
|
|
|
|
|
|
VOLUME ["/var/syncthing"]
|
|
|
|
|
2018-02-04 21:43:14 +00:00
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
|
|
|
|
COPY --from=builder /go/src/github.com/syncthing/syncthing/syncthing /bin/syncthing
|
|
|
|
|
2018-07-04 06:42:29 +00:00
|
|
|
RUN apk update \
|
|
|
|
&& apk add su-exec
|
2018-02-04 21:43:14 +00:00
|
|
|
|
|
|
|
ENV STNOUPGRADE=1
|
2018-07-04 06:42:29 +00:00
|
|
|
ENV PUID=1000
|
|
|
|
ENV PGID=1000
|
2018-02-04 21:43:14 +00:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=1m --timeout=10s \
|
|
|
|
CMD nc -z localhost 8384 || exit 1
|
|
|
|
|
2018-07-04 06:42:29 +00:00
|
|
|
ENTRYPOINT chown $PUID:$PGID /var/syncthing \
|
|
|
|
&& su-exec $PUID:$PGID /bin/syncthing -home /var/syncthing/config -gui-address 0.0.0.0:8384
|