如何以随机用户身份在容器中 运行 github cli
how to run github cli in container as random user
我已设法在容器中安装 github cli,但我无法 运行 作为随机用户(出于安全原因,open shift 将 运行s 容器作为随机用户)
我应该预先 create/chmod/chown 哪些目录才能使其工作?
谢谢!
docker 文件:
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.
...
docs 中有一个错误,它是
gh --version
不是
gh version
还有RUN chmod g+rwx -R /usr/local/bin/
前面提到的命令有帮助。
我已设法在容器中安装 github cli,但我无法 运行 作为随机用户(出于安全原因,open shift 将 运行s 容器作为随机用户) 我应该预先 create/chmod/chown 哪些目录才能使其工作?
谢谢!
docker 文件:
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.
...
docs 中有一个错误,它是
gh --version
不是
gh version
还有RUN chmod g+rwx -R /usr/local/bin/
前面提到的命令有帮助。