我正在使用从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安装supervisor,如下所示:
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')
supervisor
我在这里遗失了什么? CentOS6不支持主管吗?什么是正确的安装方式?
注意:我可以直接从repos安装,但版本很旧:
supervisor noarch 2.1-9.el6 epel
我很确定我会遗漏很多功能
更新
使用推荐的命令supervisor
安装pip install 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
有什么想法吗?
答案 0 :(得分:2)
您的原始问题(使用easy_install
解决方案)是PyPi(包存储库)现在需要https://
个连接。 easy_install
根本就不知道这一点,所以当它试图联系http://pypi.python.org/simple/supervisor/时,它会得到:
HTTP/1.1 403 SSL is required
所以easy_install
简直无法工作。
我不确定是什么导致了meld3
包的错误,但如果你还在使用EPEL存储库,那么你也可以安装{{1} } package:
python-meld
答案 1 :(得分:0)
我通过安装
给你一个工作的DockerfileFROM centos:centos6
RUN yum update -y && \
yum install -y epel-release && \
yum install -y iproute python-setuptools hostname inotify-tools yum-utils which && \
yum -y install python-pip && \
yum clean all && \
pip install supervisor
easy_install问题的解决方法。
我希望这会有所帮助。