Faas: Cannot push example to remote

Created on 5 Nov 2017  路  7Comments  路  Source: openfaas/faas

I create a docker swam on my localhost running this tutorial. I then create the examplary function using this tutorial. When doing faas-cli push -f hello-python.yml
I'm getting:

$ faas-cli push -f hello-python.yml 
[0] > Pushing: hello-python.
The push refers to a repository [docker.io/library/hello-python]
b2a90e359469: Preparing 
05a203ee051c: Preparing 
6b94e240f4a0: Preparing 
f7c0b336f1ba: Preparing 
92b8df4ef228: Preparing 
2cf17ef897d7: Waiting 
bc09eab81965: Waiting 
5a05e2c1de01: Waiting 
15994f1f5ae9: Waiting 
12211dbcbe79: Waiting 
ef763da74d91: Waiting 
denied: requested access to the resource is denied
2017/11/05 19:26:52 ERROR - Could not execute command: [docker push hello-python]

When doing the deploy command, the functions gets deployed. When doing the same procedure on my remote machine and therefore changing the gateway address in hello-python.yml, the output for push and deploy are the same: Pushing does not work, deploying does. The function even appears in the ui on the remote server, but cannot be invoked since it cannot be reached.

Most helpful comment

Cool. So now, if you haven't done so already, you need to edit your hello-python.yml to add your account/user namespace to the front of the image name:

functions:  
  hello-python:
    lang: python
    handler: ./hello-python
    image: hello-python

becomes:

functions:  
  hello-python:
    lang: python
    handler: ./hello-python
    image: <username>/hello-python

All 7 comments

Hello @maxbry,

Can you confirm you have logged in to your docker hub account on the machine prior to attempting to push, please?

$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: maxbry
Password: 
Login Succeeded
$ faas-cli push -f hello-python.yml 
[0] > Pushing: hello-python.
The push refers to a repository [docker.io/library/hello-python]
b2a90e359469: Preparing 
05a203ee051c: Preparing 
6b94e240f4a0: Preparing 
f7c0b336f1ba: Preparing 
92b8df4ef228: Preparing 
2cf17ef897d7: Waiting 
bc09eab81965: Waiting 
5a05e2c1de01: Waiting 
15994f1f5ae9: Waiting 
12211dbcbe79: Waiting 
ef763da74d91: Waiting 
denied: requested access to the resource is denied
2017/11/05 20:17:51 ERROR - Could not execute command: [docker push hello-python]

Cool. So now, if you haven't done so already, you need to edit your hello-python.yml to add your account/user namespace to the front of the image name:

functions:  
  hello-python:
    lang: python
    handler: ./hello-python
    image: hello-python

becomes:

functions:  
  hello-python:
    lang: python
    handler: ./hello-python
    image: <username>/hello-python

Richard is correct, you'll need to specify your Docker Hub account there under the image: prefix.

Ah great, that solved it!

Derek close

No probs Maxbry. Let us know if we can help again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hotjunfeng picture hotjunfeng  路  5Comments

alexellis picture alexellis  路  5Comments

ndarilek picture ndarilek  路  3Comments

rorpage picture rorpage  路  7Comments

edouardkleinhans picture edouardkleinhans  路  8Comments