0

I'm using centos/python-36-centos7 as a base image of my application. In Dockerfile, after RUN pip install --upgrade pip, pip successfully upgrades from 9.0.1 to 18.0. Next step, at RUN pip install --no-cache-dir -r requirements.txt, docker keeps throwing error:

/bin/sh: /opt/app-root/bin/pip: /opt/app-root/bin/python3: bad interpreter: No such file or directory
The command '/bin/sh -c pip install --no-cache-dir -r requirements.txt' returned a non-zero code: 126
  • Operating systems: CentOS 7.2 64 bit
  • Docker version:18.06.0-ce, build 0ffa825

Complete Dockerfile:

FROM centos/python-36-centos7
MAINTAINER SamYu,sam_miaoyu@foxmail.com
USER root
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY . /faceDetectBaseImg
COPY ./pip.conf /etc/pip.conf
WORKDIR /faceDetectBaseImg
RUN yum install -y epel-release 
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
RUN rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro 
RUN rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
RUN yum install -y ffmpeg
RUN yum -y install libXrender
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

pip.conf:

[global]
trusted-host =  mirrors.aliyun.com
index-url = https://mirrors.aliyun.com/pypi/simple

UPDATES: problem fixed by removing pip install --upgrade pip and running pip 9.0.1. I am thinking it has something to do with pip 18.0 vs CentOS7 docker images. I would still like to know if there is a fix under pip 18.0.

Sam Yu
  • 97
  • 1
  • 6

1 Answers1

0

Problems fixed completely by pulling centOS7 image and build python from source. As a reminder, don't use the latest version of centos/python-36-centos7 as of June 2018.

Sam Yu
  • 97
  • 1
  • 6