在我的Dockerfile中,我想从github克隆一个repo。为了实现这一点,我在Dockerfile中应用了以下命令:
RUN git clone -b docker https://<pat-token>:x-oauth-basic@github.com/<mygithubaccount>/<repository.git> /myfolder
当然,方括号中的短语是占位符
当我从Dockerfile构建图像时,我可以在输出中读取身份验证错误:
remote:对密码身份验证的支持已于2021年8月13日删除。遥控器:请参阅https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-使用https URL获取有关当前推荐的身份验证模式的信息。
我认为这是我的身份验证字符串的一部分。也许我不能使用个人访问令牌?如何在Dockerfile中针对github进行正确身份验证?
修复了它-我在令牌中有一个类型