【问题标题】:how to run github cli in container as random user如何以随机用户身份在容器中运行 github cli
【发布时间】:2020-09-21 18:29:22
【问题描述】:

我已经设法在容器中安装了 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.
...

【问题讨论】:

  • 也许这个issue可以帮助你。
  • 文档中有一个错误,它是gh --version 而不是gh version

标签: docker github-cli


【解决方案1】:

docs 中有一个错误,它是 gh --version 不是 gh version

还有RUN chmod g+rwx -R /usr/local/bin/前面提到的命令有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-26
    • 2020-12-19
    • 2018-07-02
    • 2018-06-18
    • 2019-05-29
    • 2015-03-14
    • 1970-01-01
    • 2020-11-02
    相关资源
    最近更新 更多