url中的Bitbucket凭据

时间:2016-01-28 08:31:01

标签: git azure authentication bitbucket

我有这种情况,我想从天蓝色的bitbucket拉。 这个回购是私有的,所以我必须指定凭证。

所以我想尝试这样的事情:https://username:password@bitbucket.org/mycompany/myrep.git

有人知道或者这可能有用吗?或者我可能需要使用一些SSH构造?我使用Kudu ARM模板,您可以在其中指定存储库和分支,但到目前为止我没有找到指定凭据的方法。

2 个答案:

答案 0 :(得分:0)

对于bitbucket,您可以使用凭证缓存

git config --global credential.helper 'cache --timeout 3600'

关注此link

了解更多信息。

答案 1 :(得分:0)

此答案应该起作用: How to add credentials to Docker ADD command


应该像这样简单:

ARG bitbucket_pwd
ARG commit

ADD "https://user@domain.com:$bitbucket_pwd@bitbucket.org/teros/vana/raw/$commit/mw/requirements.txt"  '/temp/requirements.txt'

您可以使用--build-arg

传递ARG。
docker build --build-arg bitbucket_pwd="$bitbucket_password"