admin管理员组

文章数量:1391960

I want to make SSH available in OpenShift. This is my dockerfile:

FROM ubuntu:latest

RUN apt-get update && apt-get install -y openssh-server

RUN useradd myuser
RUN chpasswd myuser:pw

RUN mkdir /var/run/sshd

RUN ssh-keygen -A
RUN chown myuser /etc/ssh/*

EXPOSE 22

USER myuser

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

In Docker on my local machine this works perfectly fine. When I push the image to OpenShift and deploy I obtain:

sshd: no hostkeys available -- exiting.

How do I fix this?

本文标签: Cannot make host keys available in OpenShiftStack Overflow