gpt4 book ai didi

docker - Poetry 在 Docker 中安装失败

转载 作者:行者123 更新时间:2023-12-02 19:52:20 25 4
gpt4 key购买 nike

我有 alpine:edge 作为基本图像,并想在其中使用诗歌。我正在尝试像这样安装它:

RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
RUN source $HOME/.poetry/env

脚本工作没有错误,但是当我尝试实际使用它时,bash 说它没有安装:
Step 16/18 : RUN poetry install --no-dev
---> Running in 38ce454369cb
/bin/sh: poetry: not found

什么会导致这个问题?

UPD:看起来 env 文件有问题:
~/.poetry # source env
/bin/sh: /usr/bin/env: line 1: ELF: not found
/bin/sh: /usr/bin/env: line 2: �: not found
/bin/sh: /usr/bin/env: line 3: �: not found
/bin/sh: /usr/bin/env: �
: not found
/bin/sh: /usr/bin/env: ��: not found
/bin/sh: /usr/bin/env: �e�mgUa: not found
/bin/sh: /usr/bin/env: M�Z��!9!di9WۓŹ�@9�����o�!���7e�
�ݣk��: not found
/bin/sh: /usr/bin/env: �
�B��
��
��
�Q�tdR�td: not found
/bin/sh: /usr/bin/env: �n�镳�: not found
/bin/sh: /usr/bin/env: �
: not found
/bin/sh: /usr/bin/env: ���


L�@�DIklqrsvwxz: not found �9�9/lib/ld-musl-x86_64.so.1k�!�R
/bin/sh: /usr/bin/env: �������2����
��
p�
n��: not found
/bin/sh: /usr/bin/env: syntax error: unterminated quoted string
~/.poetry # source env
/bin/sh: /usr/bin/env: line 1: ELF: not found
/bin/sh: /usr/bin/env: line 2: �: not found
/bin/sh: /usr/bin/env: line 3: �: not found
/bin/sh: /usr/bin/env: �
: not found
/bin/sh: /usr/bin/env: �n�镳�: not found
/bin/sh: /usr/bin/env: �
�B��
��
��
�Q�tdR�td: not found
/bin/sh: /usr/bin/env: �e�mgUa: not found
/bin/sh: /usr/bin/env: M�Z��!9!di9WۓŹ�@9�����o�!���7e�
�ݣk��: not found
/bin/sh: /usr/bin/env: �
: not found
/bin/sh: /usr/bin/env: ���


L�@�DIklqrsvwxz: not found �9�9/lib/ld-musl-x86_64.so.1k�!�R
/bin/sh: /usr/bin/env: ��: not found
/bin/sh: /usr/bin/env: �������2����
��
p�
n��: not found
/bin/sh: /usr/bin/env: syntax error: unterminated quoted string

我试过手动将二进制文件添加到路径中,但正在运行
RUN export PATH=$PATH:/root/.poetry/bin

好像没什么效果。当我进入容器时,路径似乎没有改变。

最佳答案

我提供的最佳解决方案是手动设置 env,因为二进制文件本身安装得很好

RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
ENV PATH = "${PATH}:/root/.poetry/bin"

关于docker - Poetry 在 Docker 中安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59895745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com