First release
This commit is contained in:
commit
9d7ac34f64
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
LABEL maintainer "https://github.com/hermsi1337"
|
||||||
|
|
||||||
|
ENV ROOT_PASSWORD root
|
||||||
|
|
||||||
|
RUN apk --update add openssh \
|
||||||
|
&& sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \
|
||||||
|
&& echo "root:${ROOT_PASSWORD}" | chpasswd \
|
||||||
|
&& rm -rf /var/cache/apk/* /tmp/*
|
||||||
|
|
||||||
|
COPY entrypoint.sh /usr/local/bin/
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
ENTRYPOINT ["entrypoint.sh"]
|
12
entrypoint.sh
Executable file
12
entrypoint.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# generate host keys if not present
|
||||||
|
ssh-keygen -A
|
||||||
|
|
||||||
|
# check wether a random root-password is provided
|
||||||
|
if [ ! -z ${ROOT_PASSWORD} ] && [ "${ROOT_PASSWORD}" != "root" ]; then
|
||||||
|
echo "root:${ROOT_PASSWORD}" | chpasswd
|
||||||
|
fi
|
||||||
|
|
||||||
|
# do not detach (-D), log to stderr (-e), passthrough other arguments
|
||||||
|
exec /usr/sbin/sshd -D -e "$@"
|
Loading…
x
Reference in New Issue
Block a user