docker - 如何以随机用户身份在容器中运行 github cli
问题描述
我已经设法在容器中安装了 github cli,但我无法以随机用户身份运行它(由于安全原因,open shift 确实以随机用户身份运行容器)我应该事先创建/chmod/chown 哪些目录才能使其工作?
谢谢你!
码头文件:
RUN wget https://github.com/cli/cli/releases/download/v1.0.0/gh_1.0.0_linux_amd64.deb
RUN dpkg -i gh_*_linux_amd64.deb
RUN chmod g+rwx -R /usr/local/bin/gh # <- not enough
RUN gh version
容器日志:
...
Step 7/28 : RUN gh version
---> Running in 09d1ffbfcc02
Welcome to GitHub CLI!
To authenticate, please run `gh auth login`.
You can also set the GITHUB_TOKEN environment variable, if preferred.
The command '/bin/sh -c gh version' returned a non-zero code: 4
`/` is not writable.
...
解决方案
文档中有一个错误,它
gh --version
不是
gh version
RUN chmod g+rwx -R /usr/local/bin/
之前提到的命令也有帮助。
推荐阅读
- python - 如何根据 pandas/csv 文件在同一行中移动文件和文件夹?
- c# - 懒惰地检索用作 IEnumerable 的数组
- python - 如何解释python中使用的如下所示的变量赋值?
- scala - 根主机上带有参数的 GET 请求的 http4s 路由匹配
- pytorch - Pytorch 和 ONNX 导出中的按位移位运算符
- node.js - 我只想要名称和标签,但现在我也得到模型,你可以在输出中看到
- spring-boot - 在 Spring Boot 应用程序中从 H2 DB 读取数据的骆驼路线
- javascript - JavaScript 中的验证 - 如何使红色边框消失?
- node.js - 谷歌云功能不在 PubSub 上发布,超时
- reactjs - 用回调反应测试钩子