minikube - How do I run an image locally rather than from GCE - kubernetes layman

9,694 views
Skip to first unread message

Sunny Purewal

unread,
Jul 5, 2016, 8:54:47 AM7/5/16
to kubernetes-dev
Hey guys,

So I have followed the instructions given to set up minikube. I have an issue however. When I create an image locally I get a "ErrImagePull". I am running docker build and the image is definately present and I can log into the host with minikube ssh and docker run my image. I also see the following errror message:

Back-off pulling image "library/hellojs:latest"

It appears to append with library/ and I can only assume starts looking under GCE. This gentleman has the same issue:


How can I get a local image to run as a pod in minikube?

Cheers guys any help is greatly appreciated.

Warren Strange

unread,
Jul 5, 2016, 11:05:05 AM7/5/16
to kubernetes-dev


Have you set:

ImagePullPolicy: Never


This should use the image in the docker cache

Sunny Purewal

unread,
Jul 5, 2016, 11:22:27 AM7/5/16
to kubernetes-dev
Thank you very much for your response. Where would I set this policy?

Warren Strange

unread,
Jul 5, 2016, 11:56:01 AM7/5/16
to kubernetes-dev
In the manifest (.yaml file) for the pod, rc, etc.

For example:
  containers:
      - name: mycontainer
        image: acme/custom:latest
        imagePullPolicy: Never

Dan Lorenc

unread,
Jul 5, 2016, 12:03:30 PM7/5/16
to Warren Strange, kubernetes-dev
If you're using "kubectl run", it generates a manifest for you that happens to have imagePullPolicy set to Always by default. You can use this command to get an imagePullPolicy of "IfNotPresent", which will work for minikube:

kubectl run --image=<container> --generator=run-pod/v1

Dan Lorenc

--
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/7fde0637-6d06-4acf-87f4-e4920e45f825%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunny Purewal

unread,
Jul 5, 2016, 12:36:14 PM7/5/16
to kubernetes-dev, warren....@gmail.com
Thanks you guys have made my day!

acc...@newcom4u.ch

unread,
Aug 16, 2016, 11:36:41 AM8/16/16
to Kubernetes developer/contributor discussion
Hi,

I still get an error... =(
Maybe it's because I'm using kitematic and I'm on a mac ?

Prashanth M

unread,
May 2, 2017, 7:16:51 AM5/2/17
to Kubernetes developer/contributor discussion, warren....@gmail.com
Hi,

Neither imagePullPolicy: Never or kubectl run --image=<container> --generator=run-pod/v1, none of them work for me. I am on minikube.

Thanks

xw...@neurocoreai.com

unread,
Apr 19, 2018, 2:51:14 PM4/19/18
to Kubernetes developer/contributor discussion
Same issues here with minikube and docker 17.03.1-ce on centos 7
Any breakthrough? I'm starting to think the Hello Minikube tutorial here is missing something.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages