You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
930 B

  1. FROM alpine:3.9
  2. MAINTAINER Valentin Lab <valentin.lab@kalysto.org>
  3. ## coreutils is for ``date`` support of ``--rfc-3339=seconds`` argument.
  4. ## findutils is for ``find`` support of ``--newermt`` argument.
  5. RUN apk add rsync sudo bash openssh-server coreutils findutils
  6. RUN ssh-keygen -A
  7. ## New user/group rsync/rsync with home dir in /var/lib/rsync
  8. RUN mkdir -p /var/lib/rsync /var/log/rsync && \
  9. addgroup -S rsync && \
  10. adduser -S rsync -h /var/lib/rsync -G rsync && \
  11. chown rsync:rsync /var/lib/rsync /var/log/rsync
  12. ## Without this, account is considered locked by SSH
  13. RUN sed -ri 's/^rsync:!:/rsync:*NP*:/g' /etc/shadow
  14. ## Withouth this, force-command will not run
  15. RUN sed -ri 's%^(rsync.*:)[^:]+$%\1/bin/bash%g' /etc/passwd
  16. ## Allow rsync to access /var/mirror
  17. COPY /src /
  18. RUN chmod 440 /etc/sudoers.d/*
  19. RUN mkdir /var/run/sshd
  20. COPY ./entrypoint.sh /entrypoint.sh
  21. EXPOSE 22
  22. ENTRYPOINT [ "/entrypoint.sh" ]