如何将凭证添加到Docker

如何将凭证添加到Docker

本文介绍了如何将凭证添加到Docker ADD命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有这个:ADD https://bitbucket.org/teros/vana/raw/"$commit"/mw/requirements.txt 'requirements.txt' 但由于我需要凭据,因此HTTP请求无法正常工作。我确实知道此curl命令有效:but the HTTP request won't work since I need creds. I do know that this curl command works:bitbucket_curl(){ curl -H 'Authorization:Basic YW1bGx..plM2JyKg==' "https://api.bitbucket.org$@"} (令牌已修改,但命令正确)(token was modified, but the command is o/w right)所以也许有一个令牌可以包含在内作为Bitbucket的网址参数?So maybe there's a token I can included as a url parameter with Bitbucket?推荐答案应该很简单:ARG bitbucket_pwdARG commitADD "https://[email protected]:[email protected]/teros/vana/raw/$commit/mw/requirements.txt" '/temp/requirements.txt' 您可以使用-build-argdocker build --build-arg bitbucket_pwd="$bitbucket_password" 这篇关于如何将凭证添加到Docker ADD命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 17:27