docker新手 :centos安装SSH服务报错

2019-10-12 20:31发布

dockerfile文本:

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

EXPOSE 22
CMD /usr/sbin/sshd -D

报错内容:

root@ubuntu:/home/bcl/envdm/jichu/centos7# docker build -t yi/centos7-ssh .
Sending build context to Docker daemon 3.584kB
Step 1/10 : FROM centos
---> 0f3e07c0138f
Step 2/10 : MAINTAINER Yi.Ma findlymw@gmail.com
---> Using cache
---> f02274e5139b
Step 3/10 : RUN yum -y update
---> Using cache
---> 5cfa834cb327
Step 4/10 : RUN yum install -y passwd openssh-server openssh-clients initscripts net-tool
---> Running in 50ae963b2943
Last metadata expiration check: 14:42:08 ago on Fri Oct 11 12:20:20 2019.
No match for argument: net-tool
Error: Unable to find a match
The command '/bin/sh -c yum install -y passwd openssh-server openssh-clients initscripts net-tool' returned a non-zero code: 1

一直卡在第四步,docker新手,也看不懂,求大佬指点

标签: docker
1条回答
走好不送
2楼-- · 2019-10-12 21:02

如果我没记错的话包名是"net-tools",你少了一个s

docker里面装ssh干什么用?第一次见装ssh到容器里面的。

查看更多
登录 后发表回答