尝试在docker build上执行easy_install或pip说找不到命令 [英] Trying to execute easy_install or pip on docker build says command not found

查看:533
本文介绍了尝试在docker build上执行easy_install或pip说找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试基于amazonlinux构建一个Docker容器,它是一种centos。



我需要的软件包之一是Supervisor,但在

问题是,尽管我尝试安装python-setuptools和python-pip,但是当我尝试安装做:

  RUN easy_install管理员

 运行pip安装主管

该命令不存在

  / bin / sh:easy_install:找不到命令
命令'/ bin / sh -c easy_installsupervisor'返回非零代码:127

我尝试使用完整路径,但结果相同,而且我看到其他dockerfiles也在centos图像上这样做。

解决方案

过一会儿,我找到了原因。



默认情况下,yum已安装ling python26和easy_install脚本与python27一起运行,所以我不得不调用easy_install-2.6或安装python27软件包


I am trying to build a docker container based on amazonlinux which is sort of centos.

One of the packages I need is supervisor and it is not available on the official repos so I have to do it with easy_install or pip.

The problem is that, although I tried installing python-setuptools and python-pip, then when I try to do:

RUN easy_install supervisor

or

RUN pip install supervisor

It says the command doesn't exists

/bin/sh: easy_install: command not found
The command '/bin/sh -c easy_install supervisor' returned a non-zero code: 127

I tried with full path, but same result, and I see other dockerfiles people doing it like that on centos images.

解决方案

After a while, I found the reason.

By default, yum was installing python26 and the easy_install script runs with python27, so I had to be calling easy_install-2.6 or install the python27 package

这篇关于尝试在docker build上执行easy_install或pip说找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆