Add --no-log-init to the node user that gets created to avoid massive image sizes
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- docker, dockerfile
- 领域
- build-system, devops
调研方向
搜索 Docker 镜像构建定义中创建 node 用户的所有 useradd 命令,从 issue 中显示的命令开始。为每个适用的命令添加所请求的选项,然后构建受影响的镜像,并检查报告的 Hadolint 警告是否已解决。
由索引模型根据 Issue 内容生成。
描述
Problem
Currently the node user is created with useradd --uid 1000 --gid node --shell /bin/bash --create-home node.
When customizing the UID / GID using build args with groupmod -g "${GID}" node && usermod -u "${UID}" -g "${GID}" node, some folks are reporting they are running out of disk space and can't build the image when they have a non-1000 UID on systems that create a lot of users.
Here's a comment going into more detail: https://github.com/nickjj/docker-flask-example/pull/7#issuecomment-1266698181
Also not using --no-log-init will cause Hadolint to throw this warning: -:44 DL3046 warning: useradd without flag -l and high UID will result in excessively large Image.
The usermod command doesn't support being able to set that option so it means our only option is to delete the node user and create a new one in which case life could be simplified by setting that flag here. You could make a case this is a bug report and not feature request due to the implications of not setting this flag when you create users in a Docker image.
Solution
Add --no-log-init to all of the useradd commands that create the node user.
- 主要语言
- Dockerfile
- 星标
- 8.6k
- 派生
- 2k
- 平均合并
- 10 小时 19 分钟
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/docker-node 的其他 Issue
-
build process docs
难度 2/5 1-3 小时 新手友好度 72/100
nodejs/docker-node#2564 · 2 条评论 ·
-
build process
难度 2/5 1-3 小时 新手友好度 72/100
nodejs/docker-node#2437 ·
-
build process
难度 2/5 1-3 小时 新手友好度 64/100
nodejs/docker-node#2436 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/docker-node#1707 · 3 条评论 · 7 个 reaction ·
-
docs
难度 2/5 1-3 小时 新手友好度 68/100
nodejs/docker-node#1101 · 2 条评论 ·
查看 nodejs/docker-node 的全部 Issue
相似的 Issue
-
type/automation type/tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
-
priority: p3
难度 2/5 1-3 小时 新手友好度 72/100
googleapis/librarian#7636 ·
-
package-update
难度 2/5 1-3 小时 新手友好度 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
-
agentic-workflows cascade-suspected
难度 1/5 1 小时以内 新手友好度 88/100