【问题标题】:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dlih6aks/MarkupSafe/命令“python setup.py egg_info”在 /tmp/pip-build-dlih6aks/MarkupSafe/ 中失败,错误代码为 1
【发布时间】:2023-04-01 18:07:01
【问题描述】:

我正在使用https://courses.cognitiveclass.ai/ 练习 Docker,并尝试运行具有以下内容的Dockerfile

FROM python:3.6.1-alpine
RUN pip install flask
CMD ["python","app.py"]
COPY app.py /app.py

我用来运行的命令Dockerfile

sudo docker image build -t python-hello-world .

当我执行此操作时,它只完成了 1/5 步,而 2/5 步失败并出现以下错误。

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dlih6aks/MarkupSafe/
You are using pip version 9.0.1, however version 21.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip install flask' returned a non-zero code: 1

我需要对Dockerfile 进行任何更改吗?

参考:https://courses.cognitiveclass.ai/courses/course-v1:IBMDeveloperSkillsNetwork+CO0101EN+v1/courseware/a4f90ba011b740f3b2542acd5fcb7ca6/1baf0640d41543fc9c8b832068551d2c/?child=first

【问题讨论】:

    标签:
    python
    docker
    pip