-
Notifications
You must be signed in to change notification settings - Fork 209
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 844 Bytes
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM alpine:3.22 AS base
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
# Development image
FROM base AS development
RUN apk update && \
apk add bats && \
rm -rf /var/cache/apk/* \
;
# Release image
FROM base AS build
ENTRYPOINT ["/entry.sh"]
CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config"]