我有一个Django项目,我正试图与Docker建立这个项目。我用诗,所以我得把诗装在容器里。下面是我的Dockerfile。
FROM python:3.9.7-alpine
WORKDIR /usr/src/app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install curl because it does not exist on alpine
RUN apk --no-cache add curl
# install poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
# install dependencies
RUN poetry install
COPY . .然而,它给出了这个模糊的错误,这一点都没有帮助:
Traceback (most recent call last):
File "<stdin>", line 440, in run
File "<stdin>", line 464, in install
File "<stdin>", line 589, in install_poetry
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/root/.local/share/pypoetry/venv/bin/python', '-m', 'pip', 'install', 'poetry==1.1.8']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 837, in <module>
File "<stdin>", line 833, in main
File "<stdin>", line 443, in run
AttributeError: 'NoneType' object has no attribute 'decode'
The command '/bin/sh -c curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -' returned a non-zero code: 1还没有发现任何与此相关的问题或帖子,所以我想问一下是否有人遇到过这个问题,或者有人知道如何解决这个问题。
提前谢谢。
发布于 2021-09-17 17:58:17
不幸的是,安装程序脚本隐藏了原始错误消息。否则,您可以看到,由于缺少compiler.Install,无法构建密码包-- 文档中列出的包(gcc musl-dev python3-dev libffi-dev openssl货),而且它应该能工作。
https://stackoverflow.com/questions/69220667
复制相似问题