-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
同步镜像到内网私有镜像仓库(Harbor)时报错:unauthorized to access repository #137
Comments
可以把完整的日志发一下,如果同步一个镜像的时候没有找到对应的认证信息的话,会有 |
换成了harbor上我个人的账号以后,可以正常同步了,所以应该是那个ci机器人账号(robot$mgsc+ci)的问题,请问用户名中包含$符号的话,在auth.yaml里面需要转义吗? @hhyasdf |
理论上应该是不需要的,就是正常的 json 解析。 |
@hhyasdf 好的,谢谢,反正先用我自己的账号好了,能用就行,完整错误日志如下,可以做个参考:
|
这里的原因应当是,读取 auth信息时,代码使用了 os.ExpandEnv() ,导致$后面的内容作为env被识别和替换了。 |
Bug Report
Type: bug report
What happened
尝试从docker hub同步一个镜像到内网私有镜像仓库时报错,错误日志如下:
What you expected to happen
期望镜像能同步成功
How to reproduce it (as minimally and precisely as possible)
执行命令:./image-syncer --auth ./auth.yaml --images ./images.yaml
auth.yaml:
images.yaml
Anything else we need to know?
1.真实镜像仓库域名使用registry.xxx.com进行了替换,mgsc是harbor上建的一个project
2. auth里面的账号信息不是harbor的管理员账号,而是mgsc project下的ci用途账号,拥有mgsc project下的所有权限.我尝试在auth.yaml里面写 registry.xxx.com 或者 registry.xxx.com/mgsc ,均失败,我不确定哪种写法是正确的.
Environment
cat /etc/os-release
): centos 7habor
): habor v2.6.2-498e7e21The text was updated successfully, but these errors were encountered: