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

当前main分支构建的docker 无法正常运行 #1453

Closed
1 of 5 tasks
jfy3d opened this issue May 12, 2024 · 4 comments
Closed
1 of 5 tasks

当前main分支构建的docker 无法正常运行 #1453

jfy3d opened this issue May 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jfy3d
Copy link

jfy3d commented May 12, 2024

例行检查

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

你的版本

  • [] 公有云版本
  • [x ] 私有部署版本, 具体版本号: 4.8 alpha3, 当前main分支

问题描述, 日志截图
打开登录页报错,也不能登录
只有docker 有这个问题, pnpm dev 正常

Error: Failed to load native binding
at Object. (/app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:333:11)
at Module.compile (node:internal/modules/cjs/loader:1256:14)
at Module.extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module.load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at mod.require (/app/node_modules/.pnpm/[email protected]
@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:64:28)
at require (node:internal/modules/cjs/helpers:121:18)
at 83542 (/app/projects/app/.next/server/pages/api/common/system/getInitData.js:1:85)
at o (/app/projects/app/.next/server/webpack-api-runtime.js:1:128) {
[cause]: [
Error: Cannot find module './jieba.linux-x64-musl.node'
Require stack:
- /app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js
- /app/projects/app/.next/server/pages/api/common/system/getInitData.js
- /app/node_modules/.pnpm/[email protected]
@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/future/helpers/module-loader/node-module-loader.js
- /app/node_modules/.pnpm/[email protected]
@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/future/helpers/module-loader/route-module-loader.js
- /app/node_modules/.pnpm/next@13.5.2_@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js
- /app/node_modules/.pnpm/next@13.5.2_@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/next.js
- /app/projects/app/server.js
at Module.resolveFilename (node:internal/modules/cjs/loader:1077:15)
at /app/node_modules/.pnpm/[email protected]
@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:54:36
at Module.load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at mod.require (/app/node_modules/.pnpm/[email protected]
@babel[email protected][email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:64:28)
at require (node:internal/modules/cjs/helpers:121:18)
at requireNative (/app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:199:16)
at Object. (/app/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:306:17)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [Array]
},

复现步骤

制作docker版,打开网页

预期结果

相关截图

@jfy3d jfy3d added the bug Something isn't working label May 12, 2024
@jfy3d
Copy link
Author

jfy3d commented May 13, 2024

是不是Mac下 build docker 不行? jieba库平台不统一?

@c121914yu
Copy link
Collaborator

c121914yu commented May 14, 2024

mac不清楚,但是git action的arm是ok的。 不是必须打包arm,可以指定platform试试

@c121914yu
Copy link
Collaborator

#1468 关联。先试试这个

@jfy3d
Copy link
Author

jfy3d commented May 15, 2024

我是x86 mac,用了 docker buildx --platform linux/amd64也不行 镜像里的jieba还是 darwin 版本的。
我从官方的4.8镜像里拷贝出了jieba linux版本
本地dockerfile 加上:
COPY ./jieba/@[email protected] /app/node_modules/.pnpm/@[email protected]
COPY ./jieba/@[email protected] /app/node_modules/.pnpm/@[email protected]
COPY ./jieba/@[email protected] /app/node_modules/.pnpm/@[email protected]

这样build出的镜像能跑起来

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

2 participants