Skip to content

docker compose启动报错,修改Dockerfile解决 #153

@s7r7us

Description

@s7r7us
26738431a015d/lxml-6.0.1.tar.gz (4.1 MB)
#14 9.554      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 20.9 MB/s  0:00:00
#14 9.896   Installing build dependencies: started
#14 11.57   Installing build dependencies: finished with status 'done'
#14 11.58   Getting requirements to build wheel: started
#14 12.05   Getting requirements to build wheel: finished with status 'error'
#14 12.06   error: subprocess-exited-with-error
#14 12.06
#14 12.06   × Getting requirements to build wheel did not run successfully.
#14 12.06   │ exit code: 1
#14 12.06   ╰─> [3 lines of output]
#14 12.06       Building lxml version 6.0.1.
#14 12.06       Building without Cython.
#14 12.06       Error: Please make sure the libxml2 and libxslt development packages are installed.
#14 12.06       [end of output]
#14 12.06
#14 12.06   note: This error originates from a subprocess, and is likely not a problem with pip.
#14 12.07 error: subprocess-exited-with-error
#14 12.07
#14 12.07 × Getting requirements to build wheel did not run successfully.
#14 12.07 │ exit code: 1
#14 12.07 ╰─> See above for output.
#14 12.07
#14 12.07 note: This error originates from a subprocess, and is likely not a problem with pip.
#14 ERROR: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1
------
 > [ 9/10] RUN pip install -r requirements.txt:
12.06       [end of output]
12.06
12.06   note: This error originates from a subprocess, and is likely not a problem with pip.
12.07 error: subprocess-exited-with-error
12.07
12.07 × Getting requirements to build wheel did not run successfully.
12.07 │ exit code: 1
12.07 ╰─> See above for output.
12.07
12.07 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:13

--------------------

  11 |     COPY requirements.txt ./requirements.txt

  12 |

  13 | >>> RUN pip install -r requirements.txt

  14 |

  15 |     RUN mkdocs build

--------------------

failed to solve: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1

修改dockerfile,添加以下内容解决

RUN apk update &&
apk add --no-cache --virtual .build-deps
build-base
libxml2-dev
libxslt-dev &&
# 升级 pip 本身以确保其具备最新的功能和修复
pip install --upgrade pip &&
# 注意:如果 requirements.txt 中包含了 lxml,以下安装命令需要系统依赖已就位
rm -rf /var/cache/apk/*

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions