-
Notifications
You must be signed in to change notification settings - Fork 15.8k
fix/linuxkit安装locale #9345
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
base: main
Are you sure you want to change the base?
fix/linuxkit安装locale #9345
Conversation
解决linuxkit 精简镜像对 locale 裁剪导致中文乱码问题
|
@MonkeyCode-AI 帮忙 review |
|
MonkeyCode-AI 正在分析任务... |
MonkeyCode-AI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是 MonkeyCode AI 编程助手,你可以在 GitHub 仓库的 PR 中 at @MonkeyCode-AI 来呼唤我。
任务执行细节请参考: https://monkeycode-ai.com
代码审查结果
通过安装 glibc locale 相关包并显式设置 LANG/LC_ALL,能够修复精简镜像下 JVM UTF-8 相关中文乱码问题;但 Dockerfile 兼容性与启动命令形式仍有改进空间。
| 🚨 Critical | 💡 Suggestion | |
|---|---|---|
| 0 | 2 | 2 |
Monkey Code Suggestion 1. CMD 使用 shell 形式且包含分号链式命令,信号转发/优雅退出可能不佳 CMD sleep 60 && exec java -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-system-start-3.9.1.jar 2. yum 安装建议增加失败可见性与最小化安装选项 (jeecg-boot/jeecg-module-system/jeecg-system-start/Dockerfile:10-13) yum install -y --setopt=tsflags=nodocs
Removed the encoding option from the Java command in the Dockerfile. fix. Warning warning
|
@MonkeyCode-AI ,已修复警告,接受建议- 请继续代码审查 |
|
MonkeyCode-AI 正在分析任务... |
MonkeyCode-AI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是 MonkeyCode AI 编程助手,你可以在 GitHub 仓库的 PR 中 at @MonkeyCode-AI 来呼唤我。
任务执行细节请参考: https://monkeycode-ai.com/tasks/public?id=d32b1bdc-439f-4030-ab30-8add6a1e168d
代码审查结果
通过补齐 glibc locale 并设置 LANG/LC_ALL 修复精简镜像下 JVM 中文乱码问题,同时改进 CMD 使 Java 进程成为 PID 1 便于信号处理,但需注意基础镜像包管理器/locale 包选择与构建层体积问题。
✨ 代码亮点
- 通过补齐 UTF-8 locale 并设置 LANG/LC_ALL,从根源解决精简镜像下 JVM 编码环境不完整导致的乱码
- CMD 改为
exec java ...让 Java 成为 PID 1,利于信号转发与优雅退出
解决linuxkit 精简镜像对 locale 裁剪导致jvm -Dfile.encoding=UTF-8 指定编码无效,进一步造成日志模块记录中文日志的乱码问题