ssh/Dockerfile

29 lines
736 B
Docker
Raw Normal View History

2023-07-26 10:56:43 +00:00
# NAME leenooks/ssh
# VERSION latest
FROM alpine
# Change to http respositories, so they we can cache the install packages
RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi
ENV SSH_KEY_PATH=/etc/ssh/keys
# Base
RUN apk add --no-cache bash git unzip openssh
RUN sed -i -e "s:#HostKey\ /etc/ssh:HostKey ${SSH_KEY_PATH}:" -e "s:#PasswordAuthentication yes:PasswordAuthentication no:" /etc/ssh/sshd_config
2023-07-26 10:56:43 +00:00
RUN adduser -g "Hosting Admin User" -u 1000 -G www-data -h /home/lamp -HD lamp\
&& echo "lamp:*" | chpasswd -e
2023-07-26 10:56:43 +00:00
# DB Clients
RUN apk add --no-cache mariadb-client postgresql-client
COPY init /sbin/
2023-07-26 11:13:08 +00:00
VOLUME [ "/etc/ssh/keys","/home/lamp" ]
2023-07-26 10:56:43 +00:00
EXPOSE 22
# Starting
ENTRYPOINT [ "/sbin/init" ]