诗歌安装失败 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:环境文件似乎有问题:
~/.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
好像没有效果。当我shell进入容器的时候,path好像没变。
我提出的最佳解决方案是手动设置 env,因为二进制文件本身可以很好地安装
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
ENV PATH = "${PATH}:/root/.poetry/bin"
我有 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:环境文件似乎有问题:
~/.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
好像没有效果。当我shell进入容器的时候,path好像没变。
我提出的最佳解决方案是手动设置 env,因为二进制文件本身可以很好地安装
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
ENV PATH = "${PATH}:/root/.poetry/bin"