【发布时间】:2018-07-02 23:50:56
【问题描述】:
我在一个从 CentOS 6 创建的 Docker 容器中工作。这基本上是 Dockerfile 的样子:
FROM centos:centos6
RUN yum update -y && \
yum install -y epel-release && \
yum install -y iproute python-setuptools hostname inotify-tools yum-utils which && \
yum clean all && \
easy_install supervisor
ADD container-files /
VOLUME ["/data"]
ENTRYPOINT ["/config/bootstrap.sh"]
当我运行 docker build . -t test 构建和测试映像时,它最终会出现以下错误:
...
Searching for supervisor
Reading http://pypi.python.org/simple/supervisor/
Couldn't find index page for 'supervisor' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for supervisor
error: Could not find suitable distribution for Requirement.parse('supervisor')
我也尝试过安装第一个 pip,然后使用 pip 安装主管,如下所示:
RUN yum update -y && \
yum install -y epel-release && \
yum install -y iproute python-setuptools hostname inotify-tools yum-utils which && \
yum clean all && \
easy_install pip && \
pip install supervisor
在这种情况下,最终会出现以下错误:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
- 我有互联网连接
- 我不在任何防火墙和/或代理后面
- 我没有任何 AV,因为我是从 Fedora 27 构建容器
- 我没有启用任何 IPTables 和/或 SELinux
- 其他一切都正确安装,唯一失败的是
supervisor
我在这里遗漏了什么? CentOS6不支持supervisor吗?安装这个的正确方法是什么?
注意:我可以直接从 repos 安装,但版本真的很旧:
supervisor noarch 2.1-9.el6 epel我很确定我会丢失很多功能
更新:
使用推荐的命令pip install supervisor 安装supervisor 并尝试启动容器docker run test 后它不起作用,我可以看到以下错误:
Traceback (most recent call last):
File "/usr/bin/supervisord", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: meld3>=0.6.5
有什么想法吗?
【问题讨论】:
-
我将错误跟踪到easy_install。检查Triying execute easy_install docker
标签: docker pip centos6 supervisord easy-install