使用百度云镜像 docker pull hub.baidubce.com/mythos/alpine-ssh:1.0
docker build -t alpine-ssh .
docker run --name sshd -p 8989:22 alpine-ssh
docker exec -it sshd passwd
ssh root@localhost -p 8989
base on alpine:3.8
FROM alpine:3.8
MAINTAINER mythos "[email protected]"
RUN apk add --no-cache openssh-server \
&& ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \
&& ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \
&& ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key \
&& ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key \
&& echo "PermitRootLogin yes" >> /etc/ssh/sshd_config \
&& echo "root:caishi" | chpasswd
EXPOSE 22
ENTRYPOINT /usr/sbin/sshd -D
Content type
Image
Digest
Size
2.6 MB
Last updated
almost 8 years ago
docker pull mythkuang/alpine-ssh