containers-syncthing/Dockerfile

33 lines
1.1 KiB
Text
Raw Normal View History

FROM alpine:latest AS build
2019-09-10 23:10:18 +00:00
MAINTAINER "f <f@sutty.nl>"
2019-09-11 01:32:07 +00:00
ARG VERSION=1.8.0
2019-09-11 01:32:07 +00:00
RUN apk add --no-cache binutils
2019-09-11 01:32:07 +00:00
RUN wget https://github.com/syncthing/syncthing/releases/download/v${VERSION}/syncthing-linux-amd64-v${VERSION}.tar.gz
RUN tar x -Of syncthing-linux-amd64-v${VERSION}.tar.gz syncthing-linux-amd64-v${VERSION}/syncthing \
> /usr/local/bin/syncthing
RUN chmod +x /usr/local/bin/syncthing
RUN strip --strip-all /usr/local/bin/syncthing
COPY ./syncthing_start.sh /usr/local/bin/syncthing_start
2019-09-30 19:26:54 +00:00
RUN chmod 755 /usr/local/bin/syncthing_start
2019-09-11 01:32:07 +00:00
FROM sutty/monit:latest
# Syncthing runs with the same uid and gid for Sutty so ownership is
# kept, since ST doesn't sync these.
RUN addgroup -g 82 -S syncthing
RUN adduser -s /bin/sh -G www-data -D -u 1000 -h /home/syncthing syncthing
2019-09-11 01:32:07 +00:00
RUN apk add --no-cache ca-certificates daemonize
2019-09-11 01:32:07 +00:00
COPY ./monit.conf /etc/monit.d/syncthing.conf
COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start
COPY --from=build /usr/local/bin/syncthing /usr/local/bin/syncthing
2019-09-11 01:32:07 +00:00
EXPOSE 22000
EXPOSE 22000/udp
VOLUME /home/syncthing