I setup a self-hosted registry on my machine to store the docker image files to test it thoroughly using minikube (lightweight Kubernetes implementation for local development).
Though I'm able to successfully push & pull repositories from local registry using docker push and docker pull commands but while trying to run a pod locally, facing below issue :
Error
Failed to pull image "localhost:5000/dev/customer:v1": rpc error: code = Unknown desc
= Error response from daemon: Get http://localhost:5000/v2/: dial tcp 127.0.0.1:5000: getsockopt: connection refused
Here's the list of events I noticed while inspecting the pod.
Pod Events
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 16m default-scheduler Successfully assigned custappdeployment-6c8ddcc5d8-2zdfn to minikube
Normal SuccessfulMountVolume 16m kubelet, minikube MountVolume.SetUp succeeded for volume "default-token-s5nlw"
Normal BackOff 16m (x2 over 16m) kubelet, minikube Back-off pulling image "localhost:5000/dev/customer:v1"
Warning Failed 16m (x2 over 16m) kubelet, minikube Error: ImagePullBackOff
Normal Pulling 15m (x3 over 16m) kubelet, minikube pulling image "localhost:5000/dev/customer:v1"
Warning Failed 15m (x3 over 16m) kubelet, minikube Failed to pull image "localhost:5000/dev/customer:v1": rpc error: code = Unknown desc
= Error response from daemon: Get http://localhost:5000/v2/: dial tcp 127.0.0.1:5000: getsockopt: connection refused
Warning Failed 15m (x3 over 16m) kubelet, minikube **Error: ErrImagePull**
Please see below the docker pull command output.
PS C:\Sunny\Projects\NodeApps\Nodejs-Apps\Customer> docker pull localhost:5000/dev/customer:v1
v1: Pulling from dev/customer
Digest: sha256:edf0b716728b1cc00f7d8eed76fb3bdceadf1a60a46b9e4f80d983a64389e95c
Status: Image is up to date for localhost:5000/dev/customer:v1