gpt4 book ai didi

docker - 无法使用easy_install或pip在CentOS 6.9中安装主管

转载 作者:行者123 更新时间:2023-12-02 21:18:35 24 4
gpt4 key购买 nike

我正在从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安装 super 用户,如下所示:
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不支持主管吗?什么是正确的安装方式?

    Note: I could install directly from repos but the version is really old: supervisor noarch 2.1-9.el6 epel I am pretty sure I will be missing a lot of features



    更新:

    使用推荐的命令 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

    有任何想法吗?

    最佳答案

    您最初的问题(使用easy_install解决方案)是软件包存储库PyPi现在需要https://连接。 easy_install根本不知道这一点,因此当它尝试联系http://pypi.python.org/simple/supervisor/时,它会得到:

    HTTP/1.1 403 SSL is required

    所以 easy_install根本行不通。

    我不确定是什么导致了有关 meld3软件包的错误,但是无论如何,如果您使用的是EPEL存储库,则最好也安装 python-meld软件包:
    FROM centos:centos6
    RUN yum update -y && \
    yum install -y epel-release && \
    yum install -y \
    iproute \
    python-setuptools \
    hostname \
    inotify-tools \
    yum-utils \
    which \
    python-meld3 \
    python-pip && \
    yum clean all && \
    pip install supervisor

    关于docker - 无法使用easy_install或pip在CentOS 6.9中安装主管,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48413931/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com