创建Dockerfile

FROM container4armhf/armhf-alpine

RUN apk update && apk add openssh && rm -rf /var/cache/apk/*
RUN  echo root:123456 | chpasswd
RUN sed -i 's/^\#PermitRootLogin\ prohibit-password/PermitRootLogin\ yes/' /etc/ssh/sshd_config
RUN ssh-keygen -A

EXPOSE 222
CMD ["/usr/sbin/sshd", "-D"]

build镜像

docker build -t ssh - < Dockerfile

运行容器

 docker run -it -d -p 222:22 --name='ssh' ssh

docker hub发布地址

https://hub.docker.com/r/yjiang/rpisshd/