forked from soniclidi/alpinelinux
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
28 lines (19 loc) · 1.18 KB
/
Dockerfile
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
FROM alpine:latest
MAINTAINER polandj
RUN apk upgrade --update && apk add openssh openssl
RUN echo "Welcome to Alpine! <http://wiki.alpinelinux.org> (polandj/aline-ssh image)" > /etc/motd
RUN openssl rand -base64 20 | passwd -u root
RUN echo "PubkeyAcceptedKeyTypes=+ssh-dss" > /etc/ssh/ssh_config
RUN echo "Protocol 2" > /etc/ssh/sshd_config \
&& echo "PasswordAuthentication no" >> /etc/ssh/sshd_config \
&& echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config \
&& echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config \
&& echo "HostKey /etc/ssh/ssh_host_ed25519_key" >> /etc/ssh/sshd_config \
&& echo "HostKey /etc/ssh/ssh_host_rsa_key" >> /etc/ssh/sshd_config
RUN echo "KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256" >> /etc/ssh/sshd_config
RUN echo "Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr" >> /etc/ssh/sshd_config
RUN echo "MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,[email protected]" >> /etc/ssh/sshd_config
ADD run.sh /run.sh
RUN chmod +x /*.sh
EXPOSE 22
CMD ["sh", "/run.sh"]