This commit is contained in:
parent
8c3b51bca8
commit
04345d7aec
4 changed files with 30 additions and 2 deletions
8
.drone.yml
Normal file
8
.drone.yml
Normal file
|
@ -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
|
||||
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
|
@ -0,0 +1,10 @@
|
|||
FROM docker.jcg.re/base-alpine
|
||||
MAINTAINER Jan Christian Grünhage <jan.christian@gruenhage.xyz>
|
||||
|
||||
RUN apk add --update \
|
||||
openssh \
|
||||
bash
|
||||
|
||||
ADD root /
|
||||
|
||||
EXPOSE 22
|
|
@ -1,3 +1,3 @@
|
|||
# docker-ssh
|
||||
# docker.jcg.re/sshd
|
||||
|
||||
Basic openssh image
|
||||
Basic openssh based sshd image
|
||||
|
|
10
root/etc/s6.d/sshd/run
Executable file
10
root/etc/s6.d/sshd/run
Executable file
|
@ -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
|
Loading…
Reference in a new issue