1.8.0 - now runs with same uid/gid as Sutty

This commit is contained in:
f 2020-09-07 15:58:38 -03:00
parent fcec9f796c
commit 531b6a1cbd

View file

@ -1,8 +1,9 @@
FROM sutty/daemonize:latest AS build FROM alpine:latest AS build
MAINTAINER "f <f@sutty.nl>" MAINTAINER "f <f@sutty.nl>"
ARG VERSION=1.3.2 ARG VERSION=1.8.0
RUN apk add --no-cache binutils
RUN wget https://github.com/syncthing/syncthing/releases/download/v${VERSION}/syncthing-linux-amd64-v${VERSION}.tar.gz 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 \ RUN tar x -Of syncthing-linux-amd64-v${VERSION}.tar.gz syncthing-linux-amd64-v${VERSION}/syncthing \
> /usr/local/bin/syncthing > /usr/local/bin/syncthing
@ -12,21 +13,18 @@ RUN strip --strip-all /usr/local/bin/syncthing
COPY ./syncthing_start.sh /usr/local/bin/syncthing_start COPY ./syncthing_start.sh /usr/local/bin/syncthing_start
RUN chmod 755 /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 FROM sutty/monit:latest
COPY --from=build /usr/local/bin/syncthing /usr/local/bin/syncthing # Syncthing runs with the same uid and gid for Sutty so ownership is
COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start # kept, since ST doesn't sync these.
COPY --from=build /usr/sbin/daemonize /usr/sbin/daemonize RUN addgroup -g 82 -S syncthing
RUN adduser -s /bin/sh -G www-data -D -u 1000 -h /home/syncthing syncthing
RUN apk add --no-cache ca-certificates daemonize
COPY ./monit.conf /etc/monit.d/syncthing.conf COPY ./monit.conf /etc/monit.d/syncthing.conf
COPY --from=build /usr/local/bin/syncthing_start /usr/local/bin/syncthing_start
RUN addgroup -S syncthing COPY --from=build /usr/local/bin/syncthing /usr/local/bin/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
EXPOSE 22000/udp EXPOSE 22000/udp