【发布时间】:2019-05-03 10:15:28
【问题描述】:
我正在尝试为 Azure 注册表重新实现 docker pull。过去,我已经按照官方文档成功地针对 Docker Hub 进行了此操作。
对于 Azure,我设法通过 _catalog 列出存储库标签并获取清单 (/manifests),但是我遇到了针对 /blobs 的身份验证问题,我收到了:
<Code>InvalidAuthenticationInfo</Code><Message>Authentication information is not given in the correct format. Check the value of Authorization header.
我的代码类似于:
const headers: any = {
Accept: mediaType
};
const config: any = {
method: "GET",
uri: `https://${registryConfig.base}/v2/${repo}/blobs/${sha}`,
headers
};
if (token) {
headers.Authorization = `Bearer ${token}`;
} else {
config.auth = { username, password };
}
return request(config)
}
这适用于我使用不记名令牌的 Docker Hub。有关如何正确针对 Azure 的 blob 服务进行身份验证的任何提示?
谢谢!
【问题讨论】:
-
为了争论,我已经通过我获得的 Bearer 令牌进行了尝试;结果是一样的。
标签: azure docker authentication layer docker-registry