Docker:openjdk:8jdkslim即使在安装之后也无法找到pip

2024-04-26 23:29:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用下面的docker文件已经有一段时间了,它工作得很好,但是今天当我试图构建它抛出的映像时,发现没有安装pip,即使它是在上一步安装的

/bin/sh: 1: pip: not found The command '/bin/sh -c pip install setuptools wheel' returned a non-zero code: 127

下面是Dockerfile的文本,直到出现错误时为止:

FROM openjdk:8-jdk-slim
LABEL maintainer="abc@ab.com"

ARG RELEASE=2.13.2
ARG UID=1000
ARG GID=1000

RUN apt-get update
RUN apt-get install --no-install-recommends -y

RUN apt-get install tzdata -y
RUN apt-get install nano -y
RUN apt-get install curl -y
RUN apt-get install vim -y
RUN apt-get install python3 -y
RUN apt-get install python3-pip -y
RUN apt-get install unzip -y
RUN ln -s `which python3` /usr/bin/python
RUN pip3 install --upgrade pip
RUN pip install setuptools wheel
RUN pip install Flask flask-swagger-ui requests
RUN apt-get install --reinstall procps -y

我不确定突然发生了什么,我试图寻找类似的问题,但没有给出这样的理由:

Docker issue: /bin/sh: pip: not foundInstall pip in dockerDocker Build can't find pip


Tags: installpipdockerrungetbinsharg