FROM alpine:3.9 MAINTAINER Valentin Lab RUN apk add rsync sudo bash openssh-server RUN ssh-keygen -A ## New user/group rsync/rsync with home dir in /var/lib/rsync RUN mkdir -p /var/lib/rsync && \ addgroup -S rsync && \ adduser -S rsync -h /var/lib/rsync -G rsync && \ chown rsync:rsync /var/lib/rsync ## Without this, account is concidered locked by SSH RUN sed -ri 's/^rsync:!:/rsync:*NP*:/g' /etc/shadow ## Withouth this, force-command will not run RUN sed -ri 's%^(rsync.*:)[^:]+$%\1/bin/bash%g' /etc/passwd ## Allow rsync to access /var/mirror COPY /src / RUN chmod 440 /etc/sudoers.d/* RUN mkdir /var/run/sshd COPY ./entrypoint.sh /entrypoint.sh EXPOSE 22 ENTRYPOINT [ "/entrypoint.sh" ]