docker - Faasd - 无法从私有注册表中提取图像
问题描述
我有一个使用 OpenFaaS 的应用程序。
特别是,我使用faasd是因为该功能将在处理能力较差的设备上运行。我有一个私有注册表,其中存在“X”函数的图像。我想从 faasd 中提取此映像以部署和执行它,但我遇到了一个问题:当我尝试执行该操作时,我似乎没有经过身份验证,但我正确传递了 registryAuth 令牌。
这里有一个我正在做的例子(按照这个https://ericstoekl.github.io/faas/operations/managing-images/#deploy-functions-with-private-registries-credentials)
邮政
<ip_address>:8080/system/functions
标题:
{
"Authorization": "mytoken"
}
身体:
{
"service": "functionName",
"image": "<registry_ip_address>/functions/functionName:<version>",
"envProcess": "/.../myprocess",
"registryAuth": <base64 token obtained from 'user:password'>,
"secrets": [
"mysecret"
]
}
我确认参数都正确,我收到此错误:
“无法提取图像 <registry_ip_address>/functions/functionName:: 无法提取:无法解析引用“<registry_ip_address>/functions/functionName:”:没有为令牌身份验证质询指定范围”
注册表运行良好,因为如果我尝试使用 docker 以经典方式下载图像,我可以提取图像。
先感谢您!
解决方案
对于 faasd,您必须制作一个凭证文件。
您的正常 ~/.docker/config.json 需要复制到/var/lib/faasd/.docker/config.json
.
https://github.com/openfaas/faasd#a-note-on-private-repos--registries
关于私人回购/注册的说明
要使用私有镜像仓库,
~/.docker/config.json
需要复制到/var/lib/faasd/.docker/config.json.
如果您想设置自己的私有注册表,请参阅本教程。
请注意,
docker login
在 MacOS 和 Windows 上运行可能会使用存储在系统帮助程序中的凭据创建一个空文件。或者,您可以使用
registry-login
OpenFaaS 云引导工具 (ofc-bootstrap) 中的命令:curl -sLSf https://raw.githubusercontent.com/openfaas-incubator/ofc-bootstrap/master/get.sh | sudo sh ofc-bootstrap registry-login --username <your-registry-username> --password-stdin # (then enter your password and hit return)
该文件将在
./credentials/
推荐阅读
- firefox - SMIL 动画不适用于 Firefox 上的 use 元素
- c++ - 下面的表达式是做什么的:x = (a1,a2,...,n);
- angular - 将日期前一天传递并保存到服务器的时刻
- android - 为什么 JobScheduler 没有按预期工作
- oracle - 从包中授予/撤销对过程的执行权限
- c++ - 如何将类的自定义数据传递给窗口回调而不将其声明为静态?
- php - 获取列的总和
- sql-server - 如何找到我的程序中没有调用 sql server 中的哪些 sql 类型?
- powershell - 如何将哈希表的输出转换为 CSV
- html - 如何使用 [(ngModel)] 在选择下拉列表中显示标签