FROM sutty/daemonize:latest AS build MAINTAINER "f " ARG VERSION=1.3.2 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 RUN chmod 755 /usr/local/bin/syncthing_start RUN echo /home/builder/packages/home > /etc/apk/repositories RUN apk add --no-cache daemonize FROM sutty/monit:latest COPY --from=build /usr/local/bin/syncthing /usr/local/bin/syncthing COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start COPY --from=build /usr/sbin/daemonize /usr/sbin/daemonize COPY ./monit.conf /etc/monit.d/syncthing.conf RUN addgroup -S syncthing RUN adduser -s /bin/sh -G syncthing -S -h /home/syncthing syncthing RUN monit -t RUN apk add --no-cache ca-certificates EXPOSE 22000 EXPOSE 22000/udp VOLUME /home/syncthing