-
Notifications
You must be signed in to change notification settings - Fork 4
禁用 oh my zsh 更新 #16
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
禁用 oh my zsh 更新 #16
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,9 @@ RUN set -eux; \ | |
| ENV LANG=en_US.UTF-8 \ | ||
| LC_ALL=en_US.UTF-8 \ | ||
| PATH=/root/.local/bin:${PATH} \ | ||
| DISABLE_AUTO_UPDATE=true \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip 💡 DISABLE_AUTO_UPDATE/UPDATE_ZSH_DAYS 对不同 oh-my-zsh 安装版本/分支的兼容性需确认 oh-my-zsh 对自动更新的开关在不同版本中可能存在差异(例如某些版本使用 DISABLE_AUTO_UPDATE、某些使用 zstyle 配置或不同变量逻辑)。UPDATE_ZSH_DAYS=99999 属于“变相不更新”,但依赖其具体实现。若镜像中 oh-my-zsh 来源或版本变更,可能导致这些变量失效,仍出现更新提示或更新行为。 建议: 建议补充一条简单验证(例如在构建阶段或 CI 中运行一次非交互 zsh 启动检查)或在 PR/README 中标注所依赖的 oh-my-zsh 安装方式与版本假设。若项目目标是完全禁用更新,尽量采用 oh-my-zsh 官方推荐的明确开关方式(在对应版本中可验证生效)。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip 💡 基础镜像层全局写死更新策略可能影响下游镜像灵活性 在 base 镜像中通过 ENV 固化 DISABLE_AUTO_UPDATE/UPDATE_ZSH_DAYS 会影响所有下游使用者;有的使用者可能希望保留更新(例如开发者本地镜像)。虽然运行时可覆盖,但默认行为已被改变。 建议: 如果该 base 镜像面向多用途,考虑将这些设置放在更上层的 dev 镜像,或通过构建参数 ARG 控制是否启用,并在文档中说明如何覆盖。 |
||
| UPDATE_ZSH_DAYS=99999 \ | ||
| ZSH_DISABLE_COMPFIX=true \ | ||
| SHELL=/usr/bin/zsh \ | ||
| WORKSPACE=/workspace | ||
|
|
||
|
|
||
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.
Warning
ZSH_DISABLE_COMPFIX=true 会禁用 compaudit/compfix 检查与修复提示。compfix 的目的之一是防止 zsh 从 group/world 可写目录加载补全脚本导致潜在代码执行风险。在容器里虽然多为单用户 root 环境,但仍可能存在挂载卷、CI 缓存、或后续镜像层引入的权限异常,从而把真实问题“静默化”。
建议: 优先通过修正补全相关目录/文件权限来消除 compfix 提示,而不是全局禁用。若必须禁用,建议在 PR 描述中明确风险与适用场景,并确认镜像运行时不会加载来自不受信任路径的补全脚本。可考虑仅在已知受控环境(例如 CI)通过运行时 env 覆盖,而不是在基础镜像里永久写死。