<p>I'm trying to create a local Kubernetes deployment using Minikube, Docker Registry, and a demo node project.</p>

<p>The first thing I did was install Docker v1.12.3, then Minikube v0.12.2.</p>

<p>Then I created a Docker Registry container by running this command (via <a href="https://docs.docker.com/registry/" rel="noreferrer">this tutorial</a>, only running the first command below)</p>

<pre><code>docker run -d -p 5000:5000 --name registry registry:2
</code></pre>

<p>Next I ran this minikube command to create a local kubernetes cluster:</p>

<pre><code>minikube start --vm-driver="virtualbox" --insecure-registry="0.0.0.0:5000"
</code></pre>

<p>My project structure looks like this:</p>

<pre><code>.
├── Dockerfile
└── server.js
</code></pre>

<p>and my Dockerfile looks like this:</p>

<pre><code>FROM node:7.1.0
EXPOSE 8080
COPY server.js .
CMD node server.js
</code></pre>

<p>Then I built my own docker image and pushed it to my private repository:</p>

<pre><code>docker build -t hello-node .
docker tag hello-node localhost:5000/hello-node
docker push localhost:5000/hello-node
</code></pre>

<p>Then I tried to run a deployment with this command:</p>

<pre><code>kubectl run hello-node --image=localhost:5000/hello-node --port=8888
</code></pre>

<p>But then I get this:</p>

<pre><code>sudo kubectl get pods --all-namespaces                                                                                                                             
NAMESPACE     NAME                          READY     STATUS         RESTARTS   AGE
default       hello-node-3745105022-gzs5a   0/1       ErrImagePull   0          11m
kube-system   kube-addon-manager-minikube   1/1       Running        4          10d
kube-system   kube-dns-v20-2x64k            3/3       Running        12         10d
kube-system   kubernetes-dashboard-mjpjv    1/1       Running        4          10d
</code></pre>

<p>I think I might be missing some kind of docker registry authentication, but as I'm googling I can't find something that I understand. Could someone please point me in the right direction?</p>

<p><strong>Edit</strong></p>

<p>After using ssh to access <code>bash</code> on the kubernetes VM and pull the <code>hello-node</code> image from my private registry by using this command:</p>

<pre><code>minikube ssh
Boot2Docker version 1.11.1, build master : 901340f - Fri Jul  1 
22:52:19 UTC 2016
Docker version 1.11.1, build 5604cbe
docker@minikube:~$ sudo docker pull localhost:5000/hello-node
Using default tag: latest
Pulling repository localhost:5000/hello-node
Error while pulling image: Get http://localhost:5000/v1/repositories/hello-node/images: dial tcp 127.0.0.1:5000: getsockopt: connection refused
</code></pre>

<p>Is <code>localhost:5000</code> the correct address to use within the kubernetes host VM?</p>

Nathan Jones
<p>It looks like you're running the registry on the host.  In fact, you need to run the registry inside the VM.  You can point your docker client to the docker daemon inside the minikube VM by running this command first
<code>
eval $(minikube docker-env)
</code>
in your shell.</p>

<p>Then, you can run the docker build command on your host, but it will build inside the VM.  </p>

<p>In fact, if your goal is to simply run the local version of your images, you should run the <code>eval $(minikube docker-env)</code> to point towards the docker daemon in your VM, and set the <code>imagePullPolicy: IfNotPresent</code> in your pod YAML.  Then, kubernetes will use a locally built image if available.</p>
