mirror of
https://github.com/jbowdre/library-syncer.git
synced 2024-11-22 01:42:19 +00:00
29 lines
725 B
Docker
29 lines
725 B
Docker
FROM alpine:3.16
|
|
|
|
LABEL org.opencontainers.image.source="https://github.com/jbowdre/library-syncer"
|
|
|
|
ENV SYNC_CMD='command="/usr/bin/rrsync -ro /syncer/library/",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding'
|
|
|
|
RUN apk add --no-cache \
|
|
openssh-server \
|
|
rsync \
|
|
rrsync \
|
|
tzdata
|
|
|
|
RUN mkdir /syncer \
|
|
&& adduser -h /home/syncer -D -s /bin/sh syncer
|
|
USER syncer
|
|
RUN mkdir -m 700 /home/syncer/.ssh
|
|
|
|
USER root
|
|
COPY ./entrypoint.sh /
|
|
RUN chmod +x /entrypoint.sh \
|
|
&& rm -rf /tmp/* \
|
|
&& rm -rf /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key
|
|
|
|
EXPOSE 22/tcp
|
|
|
|
VOLUME [ "/syncer/library", "/home/syncer/.ssh" ]
|
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
|
CMD [ "/usr/sbin/sshd", "-D" ]
|