我正在尝试将本地编写的 OpenFaaS 函数部署到 Minishift。我的 YAML 文件是:
provider:
name: faas
gateway: http://gateway-openfaas.10.10.80.33.nip.io
functions:
test:
lang: python
handler: ./test
image: 172.30.1.1:5000/test
172.30.1.1:5000是调用的结果
minishift openshift registry
当我通过 Openshift 控制台访问 OpenFaaS UI 时,我可以从那里正确部署功能。我还可以在那里看到我尝试在本地部署的功能,但是 Docker 镜像不在 Minishift Docker 注册表中。要将我的图像推送到那里,我正在尝试使用以下命令:
faas-cli push -f ./test.yml
不幸的是,我收到以下错误:
PS D:\projects> faas-cli push -f ./test.yml
[0] > Pushing test.
The push refers to a repository [172.30.1.1:5000/test]
8124325a272a: Preparing
2fbb584cb870: Preparing
e6dd715c8997: Preparing
ac20ff3419a9: Preparing
18adf8f88cf9: Preparing
ab495c1b9bd4: Waiting
09c56bd3ad6c: Waiting
a291b1700920: Waiting
8a65d1376e5b: Waiting
155a0aa5c33a: Waiting
8984417f4638: Waiting
a7d53ea16e81: Waiting
e53f74215d12: Waiting
unauthorized: repository name "test" invalid: it must be of the format
<project>/<name>
2018/03/22 11:30:53 ERROR - Could not execute command: [docker push
172.30.1.1:5000/test]
我做错了什么?感谢您提供任何帮助。
最佳答案
Looks like您需要在图像名称之前输入项目名称,例如以下示例中的 openshift
$ docker push 172.30.124.220:5000/openshift/busybox
...
cf2616975b4a: Image successfully pushed
Digest: sha256:3662dd821983bc4326bee12caec61367e7fb6f6a3ee547cbaff98f77403cab55
尝试将 test.yml 中的图像部分更改为 172.30.1.1:5000/openfaas/test
或类似内容。
您可能还需要获取访问 token 并将其与 docker login
一起使用,如以上链接所述,如果您尚未这样做的话:
$ oc whoami -t
$ docker login -u <username> -e <any_email_address> -p <token_value> <registry_service_host:port>
关于docker - 如何将 OpenFaaS 镜像推送到 Minishift/Openshift Docker 注册表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49434014/