<p>I have several docker images that I want to use with <code>minikube</code>. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this?</p>
<p>Stuff I tried:
<br>1. I tried running these commands (separately, deleting the instances of minikube both times and starting fresh)</p>
<pre><code>kubectl run hdfs --image=fluxcapacitor/hdfs:latest --port=8989
kubectl run hdfs --image=fluxcapacitor/hdfs:latest --port=8989 imagePullPolicy=Never
</code></pre>
<p>Output:</p>
<pre><code>NAME                    READY     STATUS              RESTARTS   AGE
hdfs-2425930030-q0sdl   0/1       ContainerCreating   0          10m
</code></pre>
<p>It just gets stuck on some status but never reaches the ready state.</p>
<p><br>2. I tried creating a registry and then putting images into it but that didn't work either. I might've done that incorrectly but I can't find proper instructions to do this task.</p>
<p>Please provide instructions to use local docker images in local kubernetes instance.
<br>OS: ubuntu 16.04
<br>Docker : Docker version 1.13.1, build 092cba3
<br>Kubernetes :</p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;5&quot;, GitVersion:&quot;v1.5.3&quot;, GitCommit:&quot;029c3a408176b55c30846f0faedf56aae5992e9b&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2017-02-15T06:40:50Z&quot;, GoVersion:&quot;go1.7.4&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;5&quot;, GitVersion:&quot;v1.5.2&quot;, GitCommit:&quot;08e099554f3c31f6e6f07b448ab3ed78d0520507&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;1970-01-01T00:00:00Z&quot;, GoVersion:&quot;go1.7.1&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>If someone could help me get a solution that uses docker-compose to do this, that'd be awesome.</p>
<p><strong>Edit:</strong></p>
<p>Images loaded in <code>eval $(minikube docker-env)</code>:</p>
<pre><code>REPOSITORY                                            TAG                 IMAGE ID            CREATED             SIZE
fluxcapacitor/jupyterhub                              latest              e5175fb26522        4 weeks ago         9.59 GB
fluxcapacitor/zeppelin                                latest              fe4bc823e57d        4 weeks ago         4.12 GB
fluxcapacitor/prediction-pmml                         latest              cae5b2d9835b        4 weeks ago         973 MB
fluxcapacitor/scheduler-airflow                       latest              95adfd56f656        4 weeks ago         8.89 GB
fluxcapacitor/loadtest                                latest              6a777ab6167c        5 weeks ago         899 MB
fluxcapacitor/hdfs                                    latest              00fa0ed0064b        6 weeks ago         1.16 GB
fluxcapacitor/sql-mysql                               latest              804137671a8c        7 weeks ago         679 MB
fluxcapacitor/metastore-1.2.1                         latest              ea7ce8c5048f        7 weeks ago         1.35 GB
fluxcapacitor/cassandra                               latest              3cb5ff117283        7 weeks ago         953 MB
fluxcapacitor/apachespark-worker-2.0.1                latest              14ee3e4e337c        7 weeks ago         3.74 GB
fluxcapacitor/apachespark-master-2.0.1                latest              fe60b42d54e5        7 weeks ago         3.72 GB
fluxcapacitor/package-java-openjdk-1.8                latest              1db08965289d        7 weeks ago         841 MB
gcr.io/google_containers/kubernetes-dashboard-amd64   v1.5.1              1180413103fd        7 weeks ago         104 MB
fluxcapacitor/stream-kafka-0.10                       latest              f67750239f4d        2 months ago        1.14 GB
fluxcapacitor/pipeline                                latest              f6afd6c5745b        2 months ago        11.2 GB
gcr.io/google-containers/kube-addon-manager           v6.1                59e1315aa5ff        3 months ago        59.4 MB
gcr.io/google_containers/kubedns-amd64                1.9                 26cf1ed9b144        3 months ago        47 MB
gcr.io/google_containers/kube-dnsmasq-amd64           1.4                 3ec65756a89b        5 months ago        5.13 MB
gcr.io/google_containers/exechealthz-amd64            1.2                 93a43bfb39bf        5 months ago        8.37 MB
gcr.io/google_containers/pause-amd64           
</code></pre>

<p>As the <a href="https://minikube.sigs.k8s.io/docs/handbook/pushing/#1-pushing-directly-to-the-in-cluster-docker-daemon-docker-env" rel="noreferrer">handbook</a> describes, you can reuse the Docker daemon from Minikube with <code>eval $(minikube docker-env)</code>.</p>
<p>So to use an image without uploading it, you can follow these steps:</p>
<ol>
<li>Set the environment variables with <code>eval $(minikube docker-env)</code></li>
<li>Build the image with the Docker daemon of Minikube (eg <code>docker build -t my-image .</code>)</li>
<li>Set the image in the pod spec like the build tag (eg <code>my-image</code>)</li>
<li>Set the <a href="https://kubernetes.io/docs/concepts/containers/images/#updating-images" rel="noreferrer"><code>imagePullPolicy</code></a> to <code>Never</code>, otherwise Kubernetes will try to download the image.</li>
</ol>
<p><strong>Important note:</strong> You have to run <code>eval $(minikube docker-env)</code> on each terminal you want to use, since it only sets the environment variables for the current shell session.</p>
