Search code examples
dockerkuberneteskubectlminikubedocker-registry

Unable to pull images from insecure registry through minikube


I have a local insecure docker registry which I created using the command:

docker run -d -p 5000:5000 --restart=always --name registry registry:2` 

I have added this to the /etc/docker/daemon.json as well. I tagged several images in the format localhost:5000/<orgname>/<imagename>:<tag> and pushed them to the insecure registry.

When I run curl -X GET localhost:5000/v2/_catalog I can see that they are available inside the local registry.

I started minikube with the command minikube start --insecure-registry="localhost:5000". Here, my default driver is docker (I also tried with kvm2). I enabled the registry addon as well using the command minikube addons enable registry

I have a configmap which states the image in the format I mentioned earlier. When I apply this using kubectl, I get an ImagePullBackoff error with the error message

Failed to pull image "localhost:5000/org/product:tag": rpc error: code = Unknown desc = Error response from daemon: manifest for localhost:5000/org/product:tag not found: manifest unknown: manifest unknown

Any ideas as to why this is happening?

Docker version: 19.03.8, build afacb8b7f0

Minikube version: 1.9.2

Ubuntu 20.04 LTS


Solution

  • I was able to solve this issue by replacing localhost with my IP.

    minikube start --insecure-registry="<IP-of-your-computer>:5000"
    

    Have to use the IP instead of localhost when tagging and pushing images to te local registry as well.