Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker build编译报错 #1160

Closed
1 of 2 tasks
itq5 opened this issue Apr 9, 2024 · 7 comments
Closed
1 of 2 tasks

docker build编译报错 #1160

itq5 opened this issue Apr 9, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@itq5
Copy link

itq5 commented Apr 9, 2024

例行检查

  • [x ] 我已确认目前没有类似 issue
  • [x ] 我已完整查看过项目 README,以及项目文档
  • [x ] 我使用了自己的 key,并确认我的 key 是可正常使用的
  • [x ] 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

你的版本
4.7

  • 公有云版本
  • [x ] 私有部署版本, 具体版本号:
    4.7

问题描述
docker build编译报错
复现步骤
docker build -t fastgpt --build-arg name=app .
预期结果

相关截图
.../[email protected]/node_modules/canvas install$ node-pre-gyp install --fallback-to-build --update-binary .../[email protected]/node_modules/canvas install: node-pre-gyp info it worked if it ends with ok .../[email protected]/node_modules/canvas install: node-pre-gyp info using [email protected] .../[email protected]/node_modules/canvas install: node-pre-gyp info using [email protected] | linux | arm64 .../[email protected]/node_modules/canvas install: node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-arm64.tar.gz .../[email protected]/node_modules/canvas install: node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-arm64.tar.gz .../[email protected]/node_modules/canvas install: node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v108 ABI, musl) (falling back to source compile with node-gyp) .../[email protected]/node_modules/canvas install: node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-arm64.tar.gz .../[email protected]/node_modules/canvas install: gyp info it worked if it ends with ok .../[email protected]/node_modules/canvas install: gyp info using [email protected] .../[email protected]/node_modules/canvas install: gyp info using [email protected] | linux | arm64 .../[email protected]/node_modules/canvas install: gyp info ok .../[email protected]/node_modules/canvas install: gyp info it worked if it ends with ok .../[email protected]/node_modules/canvas install: gyp info using [email protected] .../[email protected]/node_modules/canvas install: gyp info using [email protected] | linux | arm64 .../[email protected]/node_modules/canvas install: gyp ERR! find Python .../[email protected]/node_modules/canvas install: gyp ERR! find Python Python is not set from command line or npm configuration .../[email protected]/node_modules/canvas install: gyp ERR! find Python Python is not set from environment variable PYTHON

@itq5 itq5 added the bug Something isn't working label Apr 9, 2024
@itq5
Copy link
Author

itq5 commented Apr 9, 2024

@nongmo677
Copy link
Contributor

官方确实没有这个版本
https://github.com/Automattic/node-canvas/releases/
这感觉是node-pre-gyp根据你系统信息帮你构建的下载链接
arm64的系统似乎得自己源码构建,具体浏览如下
Automattic/node-canvas#1662 (comment)

@c121914yu
Copy link
Collaborator

c121914yu commented Apr 10, 2024

arm 可以考虑直接用 git action 构建。有个 personal image 的 action,个人仓库会生效。

@jingzl
Copy link

jingzl commented May 12, 2024

解决了吗?
我在ubuntu22.04 下,直接构建,报同样的错误

@ws02589111
Copy link

Same Issue:
.../node_modules/canvas install: node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-x64.tar.gz
.../node_modules/canvas install: node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-x64.tar.gz

@ws02589111
Copy link

ws02589111 commented May 17, 2024

Same Issue: .../node_modules/canvas install: node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-x64.tar.gz .../node_modules/canvas install: node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-x64.tar.gz

solution:
node-gfx/node-canvas-prebuilt#77 (comment)

ps: This solution will increase the size of the image

In my case:
update the Dockerfile line 9 to:
RUN apk add --no-cache libc6-compat build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev && apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation fontconfig && npm config set registry https://registry.npmmirror.com/ && npm install -g pnpm

@c121914yu
Copy link
Collaborator

Same Issue: .../node_modules/canvas install: node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-x64.tar.gz .../node_modules/canvas install: node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-linux-musl-x64.tar.gz

solution:
node-gfx/node-canvas-prebuilt#77 (comment)

ps: This solution will increase the size of the image

In my case:
update the Dockerfile line 9 to:
RUN apk add --no-cache libc6-compat build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev && apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation fontconfig && npm config set registry https://registry.npmmirror.com/ && npm install -g pnpm

cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants