Docker错误命令非零代码:1 python

时间:2017-06-11 13:13:25

标签: python docker pip dockerfile

当我试图建造容器时,我有问题。错误是:

The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

我不知道为什么,我遵循文档中的代码但总是出错。

Dockerfile

FROM python:2.7-slim
#
# # Set the working directory to /app
WORKDIR /app
#
# # Copy the current directory contents into the container at /app
ADD . /app
#
# # Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
#
# # Make port 80 available to the world outside this container
EXPOSE 80
#
# # Define environment variable
ENV NAME World
#
# # Run app.py when the container launches
CMD ["python", "app.py"]

1 个答案:

答案 0 :(得分:2)

看似文件位置的问题尝试给出你在dockerfile中引用的文件的绝对路径