Cog*_*ves 6 git pip docker google-cloud-platform google-cloud-source-repos
我正在尝试构建一个Dockerfile,通过pip将需求安装到它构建的容器中.我认为可能无法在谷歌的SDK /云控制台中设置某些内容.我收到此错误:
me@cloud-q2smart:~/github/jokepkg/test$ sudo pip install -r test-ggl-install/requirements.txt
Obtaining funniest from git+https://source.developers.google.com/p/cloud-q2smart/r/jokepkg#egg=funniest-0.1 (from -r test-ggl-install/requirements.txt (line 1))
Updating ./src/funniest clone
git: 'credential-gcloud.sh' is not a git command. See 'git --help'.
Username for 'https://source.developers.google.com':
Run Code Online (Sandbox Code Playgroud)
该消息看起来像是试图将'credential-gcloud.sh'传递给git,而git正在响应它不知道它应该对它意味着什么.看起来谷歌设置用于身份验证的一些内部手段已经破裂.
我真的很想从私人回购中正确安装它.我不希望开发团队因为身份验证机制被破坏而不得不将其流程更改为更麻烦的东西.
...但它很棘手......因为pip在幕后做了一些事情来调用git,看起来谷歌正试图在幕后做一些事情来告诉git如何进行身份验证.
我创建了一个项目,试图在谷歌云源中的私人仓库中安装一个简单的python包.运行它的说明如下:
( Start up google cloud shell )
$ git clone https://github.com/jnorment-q2/jokepkg.git
# pull down my sample package
$ cd jokepkg
# ( create repo in cloud )
$ git remote add google https://source.developers.google.com/p/cloud-q2smart/r/jokepkg
$ git push google master
# Change to test directory and attempt to build Dockerfile
$ cd test
$ docker build -t test --no-cache .
Run Code Online (Sandbox Code Playgroud)
这应该尝试在我的Jenkins CI创建用作临时构建环境的完全相同类型的容器中构建基于需求的依赖项.它将成功用于第一个,因为那个是公共回购,并且没有什么可以配置安全性.当它进入谷歌版本时它将失败.我不知道如何从Dockerfile解决这个问题.
如果有人能引导我朝着正确的方向前进,我会很感激.
我可以将凭证文件推送到构建环境/构建奴隶,但谷歌正在做的事情似乎优先于我为git设置的信誉:
git config --local credential.username google-svc-account
git config --local credential.helper store --file=/tmp/creds
Run Code Online (Sandbox Code Playgroud)
...我宁愿不将requirements.txt文件绑定到特定的用户ID.
尝试重置git配置
git config --global --unset credential.helper
git config --global --add --path credential.helper gcloud
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
512 次 |
| 最近记录: |