-
Notifications
You must be signed in to change notification settings - Fork 215
/
Dockerfile
19 lines (14 loc) · 669 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM alpine:3.20
RUN apk update && \
apk add --no-cache bash git openssh rsync augeas shadow rssh && \
deluser $(getent passwd 33 | cut -d: -f1) && \
delgroup $(getent group 33 | cut -d: -f1) 2>/dev/null || true && \
mkdir -p ~root/.ssh /etc/authorized_keys && chmod 700 ~root/.ssh/ && \
augtool 'set /files/etc/ssh/sshd_config/AuthorizedKeysFile ".ssh/authorized_keys /etc/authorized_keys/%u"' && \
echo -e "Port 22\n" >> /etc/ssh/sshd_config && \
cp -a /etc/ssh /etc/ssh.cache && \
rm -rf /var/cache/apk/*
EXPOSE 22
COPY entry.sh /entry.sh
ENTRYPOINT ["/entry.sh"]
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config"]