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.

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