create basic Dockerfile for having an ssh server with rsync

This commit is contained in:
Tony Blyler 2021-05-15 00:22:40 -04:00
parent 8fcc5a84e6
commit ab7a0569a9
Signed by: tblyler
GPG key ID: 7F13D9A60C0D678E
4 changed files with 26 additions and 0 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
.git

5
Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM alpine:3.13
RUN apk add --no-cache \
openssh-server \
rsync

7
Makefile Normal file
View file

@ -0,0 +1,7 @@
.PHONY: build
build:
docker build -t registry.0xdad.com/rsync-ssh-server:latest .
.PHONY: deploy
deploy: build
docker push registry.0xdad.com/rsync-ssh-server:latest

13
entrypoint.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
set -eu
ssh-keygen -A
/usr/sbin/sshd
while pgrep -f /usr/sbin/sshd; do
sleep 5
done
>&2 echo 'SSHD is no longer running'
exit 1