New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use locally built docker image? #6101
Comments
anyone? |
same question |
I am having the same problem! |
What is most likely happening is that Knative is failing to do digest resolution. In our controller we resolve image tags to digests in order in order to better guarantee immutability of Revisions. This works well if you are using a normal registry; however, it can cause problems when used with mini kube and local images. Our controller is likely trying to pull this image from DockerHub to resolve the digest (as it has no domain name prefix) and then failing. We have a configmap option you can enable to skip doing digest resolution on certain paths. You will want to edit https://github.com/knative/serving/blob/master/config/config-deployment.yaml#L45 Alternatively, you can also pass the image digest rather than tag to the Knative Service. Since it is already resolved the logic will be skipped. |
Locally built docker images don't seem to have a digest. (Possible explanation: Why doesn't my newly-created docker have a digest?)
( However this command returns the digest:
I updated my knative service.yaml, and added the digest:
Here's the new error:
So I removed
Still no luck so I tried editing
I added
What should I try next @dgerd ? |
Oh I see what you are doing here now and what you are expecting from Minikube. A docker image without a hostname prefix is assumed to be DockerHub. Your image pull policy of 'Never' prevents minikube from reaching out to DockerHub to try to fetch the image and assumes that the version you have locally is the latest and greatest. The last step should have been successful with an Image Pull policy of 'Never'. What I suspect might have went wrong here is that you edited the existing line. The existing line is part of an Alternatively, by default we will skip resolving digests with images prefixed with |
Tagging my image as I think I'm editing the right place only it's still taking DockerHub as the source because if I use
instead of |
Glad to hear it solved the problem. Makes sense that the dot is required as part of the hostname parsing. Do you happen to have a link to the documentation you were looking at to set this up originally? I can add some text about this so others don't run into the same issue. |
actully dismiss this part. I just learned that the image was not being pulled correctly and it was probably using the prior revision hence why it still worked fine. the error:
Here's my
Regarding the documentation, I think I briefly looked at hello-world examples. An example helloworld-nodejs. I will probably create a pull request for this issue and a few others if that's ok with you. |
You image will not be 'pulled' in this setup. My understanding is it is not being pushed to any registry, but rather using the images that are being built and available locally from the docker daemon.
This looks correct to me as well |
That is more than okay. Would love the contribution! |
This commit documents this issue (knative/serving#6101)
* add instruction on how to use local docker registry This commit documents this issue (knative/serving#6101) * Update docs/serving/getting-started-knative-app.md Co-Authored-By: Dan Gerdesmeier <dangerd@google.com> * edit to clarify this sample is deployed from gcr * Update docs/serving/getting-started-knative-app.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/getting-started-knative-app.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/getting-started-knative-app.md Co-Authored-By: RichieEscarez <rescarez@google.com> * add line break Co-authored-by: Dan Gerdesmeier <dangerd@google.com> Co-authored-by: RichieEscarez <rescarez@google.com>
In what area(s)?
Ask your question here:
I have built a simple docker image for a node app that serves a
hello world
on port 8080, if Iminikube ssh
and rundocker images
I can see my image underminikube-test
.I can deploy my service normally in minikube like this (and it works):
However I'm getting revision error when deploying it to knative and some investigation shows it can't pull the image.
service.yaml:
then:
Help?
The text was updated successfully, but these errors were encountered: