繁体   English   中英

Poetry 在 Docker 中安装失败

[英]Poetry fails to install in Docker

我有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"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM