diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0788ed6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,8 @@ +pipeline: + docker: + image: plugins/docker + repo: docker.jcg.re/sshd + registry: docker.jcg.re + secrets: [ docker_username, docker_password ] + tags: latest + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..777f365 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM docker.jcg.re/base-alpine +MAINTAINER Jan Christian Grünhage + +RUN apk add --update \ + openssh \ + bash + +ADD root / + +EXPOSE 22 diff --git a/README.md b/README.md index 9d77ab0..1042acf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# docker-ssh +# docker.jcg.re/sshd -Basic openssh image \ No newline at end of file +Basic openssh based sshd image diff --git a/root/etc/s6.d/sshd/run b/root/etc/s6.d/sshd/run new file mode 100755 index 0000000..b61199d --- /dev/null +++ b/root/etc/s6.d/sshd/run @@ -0,0 +1,10 @@ +#!/bin/bash +mkdir -p /root/.ssh +if [[ -n ${SSH_KEY} ]]; then + echo ${SSH_KEY} > /root/.ssh/authorized_keys + chmod 700 /root/.ssh + chmod 600 /root/.ssh/* +fi +sed -i -e "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config +ssh-keygen -A +/usr/sbin/sshd -D