如何将OpenFaaS映像推送到Minishift / Openshift Docker注册表?

我正在尝试将本地编写的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或类似的内容.

如果您尚未这样做,您可能还需要获取访问令牌并将其用于docker登录,如上面的链接所述:

$oc whoami -t
$docker login -u <username> -e <any_email_address> -p <token_value> <registry_service_host:port>

转载注明原文:如何将OpenFaaS映像推送到Minishift / Openshift Docker注册表? - 代码日志