dockeropenshiftminishiftfaas

How to push OpenFaaS image to Minishift/Openshift Docker registry?


I'm trying to deploy a locally written OpenFaaS function to Minishift. My YAML file is:

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 is the result of calling

minishift openshift registry

When I access the OpenFaaS UI through the Openshift Console, I can deploy functions properly from there. I can also see the function I tried to deploy locally there, but the Docker image is not in the Minishift Docker registry. To push my image there, I'm trying to use the command:

faas-cli push -f ./test.yml

Unfortunately, I receive the following error:

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]

What am I doing incorrectly? Any assistance is appreciated.


Solution

  • Looks like you need a project name before your image name, like openshift in the following example

    $ docker push 172.30.124.220:5000/openshift/busybox
    ...
    cf2616975b4a: Image successfully pushed
    Digest: sha256:3662dd821983bc4326bee12caec61367e7fb6f6a3ee547cbaff98f77403cab55
    

    Try changing the image section in your test.yml to be 172.30.1.1:5000/openfaas/test or similar.

    You may also need to get an access token and use it with docker login, as described in the above link, if you have not already done so:

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