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

👷 build: optimize image size under glibc env #4025

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

hezhijie0327
Copy link
Contributor

@hezhijie0327 hezhijie0327 commented Sep 19, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

承接 #3926 中提到的新方案

  1. 沿用 Rollback 回 node:20-slim 前的方案,继承其所有特性的同时保留与 node:20-alpine 等同的小体积
    a. 从 node:20-slim 提取 nodeproxychains 的依赖项,移除对于正式环境无用的 nodejs 开发环境(如 npm 等),仅保留 node 二进制
    b. 保留 Rootless 特性,nextjs:nodejs
  2. 将应用层 Image 改用基于 glibcbusybox:latest 进行应用环境准备及用户创建
  3. 将最终 Image 使用 scratch 进行重新封装,镜像压缩
  4. [TODO] 引入基于 js 的启动器
    a. 简化 PROXY_URL DNS 解析处理逻辑,使用 dns
    b. 添加额外的诊断信息,如 PROXY_URL DNS 解析失败等
    c. 添加 isValidSSL function,用于后续检测 OSS 及 Auth URL 是否配置正确,检测异常提示添加 NODE_TLS_REJECT_UNAUTHORIZED="0"
    d. 添加对 OSS 及 Auth URL SSL 证书检测(S3_ENDPOINT, S3_PUBLIC_DOMAIN, *_ISSUER

Note:
暂未合并 #3926 新加入的 ENV [TODO] 已并入

📝 补充信息 | Additional Information

镜像大小
image
启动日志
image
错误日志
image
image
image

Copy link

vercel bot commented Sep 19, 2024

@hezhijie0327 is attempting to deploy a commit to the LobeHub Pro Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 19, 2024
@lobehubbot
Copy link
Member

👍 @hezhijie0327

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.73%. Comparing base (08c53eb) to head (a640258).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #4025     +/-   ##
=========================================
  Coverage   91.73%   91.73%             
=========================================
  Files         481      481             
  Lines       34195    34195             
  Branches     2085     3147   +1062     
=========================================
  Hits        31368    31368             
  Misses       2827     2827             
Flag Coverage Δ
app 91.73% <ø> (ø)
server 97.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Sep 19, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants