fork 0k-charms
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.

34 lines
986 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. ## gawk is for ``awk`` support of unicode strings.
  6. RUN apk add rsync sudo bash openssh-server coreutils findutils gawk
  7. RUN ssh-keygen -A
  8. ## New user/group rsync/rsync with home dir in /var/lib/rsync
  9. RUN mkdir -p /var/lib/rsync /var/log/rsync && \
  10. addgroup -S rsync && \
  11. adduser -S rsync -h /var/lib/rsync -G rsync && \
  12. chown rsync:rsync /var/lib/rsync /var/log/rsync
  13. ## Without this, account is considered locked by SSH
  14. RUN sed -ri 's/^rsync:!:/rsync:*NP*:/g' /etc/shadow
  15. ## Withouth this, force-command will not run
  16. RUN sed -ri 's%^(rsync.*:)[^:]+$%\1/bin/bash%g' /etc/passwd
  17. ## Allow rsync to access /var/mirror
  18. COPY /src /
  19. RUN chmod 440 /etc/sudoers.d/*
  20. RUN mkdir /var/run/sshd
  21. COPY ./entrypoint.sh /entrypoint.sh
  22. EXPOSE 22
  23. ENTRYPOINT [ "/entrypoint.sh" ]