diff --git a/Dockerfile b/Dockerfile index 8a20989..63c3c6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,3 +3,5 @@ FROM alpine:3.13 RUN apk add --no-cache \ openssh-server \ rsync + +RUN mkdir -p /root/.ssh && cp /etc/ssh/sshd_config /etc/default_sshd_config diff --git a/README.md b/README.md index 0987081..6880c9e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # docker-rsync-server +This is a simple docker image definition for starting an SSH server that is used for rsyncing to volume mounts. + +## Volumes + +| path | description | +|----------------------------|---------------------------------------| +| /root/.ssh/authorized_keys | the ssh keys to allow for auth | +| /etc/ssh | location for SSH host keys and config | +| anywhere else | the locations available for rsync | diff --git a/entrypoint.sh b/entrypoint.sh index 183b58c..b1e90b6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,10 @@ set -eu ssh-keygen -A +if [ ! -e '/etc/ssh/sshd_config' ]; then + cp /etc/default_sshd_config /etc/ssh/sshd_config +fi + /usr/sbin/sshd while pgrep -f /usr/sbin/sshd; do