Docker下centos安装ssh问题记录

Docker下centos安装ssh问题记录

Dockerfile文件

FROM centos
MAINTAINER Yi.Ma .com>
RUN yum -y update
RUN yum install -y passwd openssh-server openssh-clients initscripts net-tools
RUN yum install python-setuptools -y
RUN easy_install supervisor
RUN echo 'root:root' | chpasswd
RUN /usr/sbin/sshd-keygen

EXPOSE 22
CMD /usr/sbin/sshd -D

依照此Dockerfile文件进行安装时,在RUN yum install python-setuptools -y以及RUN easy_install supervisor都会出现安装错误

No match for argument: python-setuptools
Error: Unable to find a match
The command '/bin/sh -c yum install python-setuptools -y' returned a non-zero code: 1
/bin/sh: easy_install: command not found
The command '/bin/sh -c easy_install supervisor' returned a non-zero code: 127

解决办法:
FROM centos会默认拉取版本较新的centos,可能与部分安装不兼容,将FROM centos改为FROM centos:7

你可能感兴趣的:(Docker)