Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Solving the ldconfig vs unprivileged user issue

未关闭
#189 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
shell

调研方向

首先,以 root 以及 UID/GID 1000/1000 身份,在镜像 tensorflow/tensorflow:2.17.0-gpu-jupyter 中复现报告的行为,使用 bashrc 启动路径,并检查 ldconfig 和 nvidia-smi。确定是否仍然需要 ldconfig,以及它应在镜像构建期间运行还是被移除;确定了能够避免所有权和权限冲突的启动行为后,即可视为完成。

由索引模型根据 Issue 内容生成。

描述

sig build dockerfiles

Following up on the problem reported in many places, but for example here at https://github.com/tensorflow/build/commit/8bfbcec2876755e263701b01e568584d4a5db744#r111483861 with a reply by @angerson at https://github.com/tensorflow/build/commit/8bfbcec2876755e263701b01e568584d4a5db744#r111514846 .

So in summary, for e.g. the tensorflow/tensorflow:2.17.0-gpu-jupyter image:

  • If you run the image in interactive mode (using e.g. the command bash when starting the container) and as the default (root) user, you get a startup message warning you that can screw up the ownership of new files created on your volumes. So the user presumably then wants to run it as an unprivileged user.

  • If you then run the image in interactive mode (using e.g. the command bash when starting the container) and as an unprivileged user (e.g. UID/GID 1000/1000), the startup message of the container tells you it's all correct and good, but ldconfig fails to run (giving /sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied error message) and perhaps also nvidia-smi will not work at all.

So it's a catch 22, and whichever way you follow the startup recommendations, you're in the wrong :)

  • Should we perhaps stop recommending users to run the software as their own UID/GID and instead just inform them that if they do, file ownership/permissions might be a problem or need attention?

  • Or should we perhaps instead run the ldconfig as part of the image build (while the build is still running as root) instead of in the bashrc file? Or will that not make nvidia-smi work anymore?

  • All that said, if I run the tensorflow/tensorflow:2.17.0-gpu-jupyter image now, I can't even find nvidia-smi installed in it anywhere. Is it still there, or can we just get rid of the ldconfig in bashrc because it's not needed anymore? If so, there's no problem anymore I suppose.

主要语言
Shell
星标
312
派生
140
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tensorflow/build 的其他 Issue

查看 tensorflow/build 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。