<p>I'm trying to run some docker images on Kubernetes.</p>
<p>docker images</p>
<pre class="lang-bash prettyprint-override"><code>master* $ docker images                                              [15:16:49]                                                                                
REPOSITORY                    TAG           IMAGE ID       CREATED             SIZE
usm                           latest        4dd5245393bf   About an hour ago   158MB
kuard                         latest        497961f486c7   4 days ago          22.9MB
</code></pre>
<p>docker container</p>
<pre class="lang-bash prettyprint-override"><code>master* $ docker ps                                                  [15:21:40]
CONTAINER ID   IMAGE                                 COMMAND                  CREATED             STATUS             PORTS                                                                                                                                  NAMES
a46850d28303   usm                                   &quot;/docker-entrypoint.…&quot;   About an hour ago   Up About an hour   0.0.0.0:6061-&gt;80/tcp, :::6061-&gt;80/tcp                                                                                                  usm
88471e086486   gcr.io/k8s-minikube/kicbase:v0.0.32   &quot;/usr/local/bin/entr…&quot;   2 days ago          Up 2 hours         127.0.0.1:49157-&gt;22/tcp, 127.0.0.1:49156-&gt;2376/tcp, 127.0.0.1:49155-&gt;5000/tcp, 127.0.0.1:49154-&gt;8443/tcp, 127.0.0.1:49153-&gt;32443/tcp   minikube
</code></pre>
<p>Dockerfile</p>
<pre><code>FROM nginx
COPY ./dist /usr/share/nginx/html
EXPOSE 80
</code></pre>
<p>kube version</p>
<pre class="lang-bash prettyprint-override"><code>master* $ minikube version                                           [15:37:13]
minikube version: v1.26.0
commit: f4b412861bb746be73053c9f6d2895f12cf78565

</code></pre>
<p>When I run <code>kubectl run mypod --image=usm</code>, I get <strong>ErrImagePull</strong></p>
<p>How to run the pod with the local docker image?</p>
<pre class="lang-bash prettyprint-override"><code>master* $ kubectl run mypod --image=usm
pod/mypod created
</code></pre>
<pre class="lang-bash prettyprint-override"><code>master* $ kubectl get pods                                           [15:07:49]
NAME    READY   STATUS         RESTARTS   AGE
mypod   0/1     ErrImagePull   0          6s
</code></pre>
<p>I'm trying to set the imagePullPolicy to never</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - image: usm
    imagePullPolicy: Never
    name: mypod
    ports:
    - containerPort: 80
      name: http
      protocol: TCP
</code></pre>
<pre class="lang-bash prettyprint-override"><code>master* $ kubectl apply -f kube-pod-usm.yaml                         [15:55:39]
pod/mypod created
</code></pre>
<pre class="lang-bash prettyprint-override"><code>master* $ kubectl get pods                                           [15:55:54]
NAME    READY   STATUS              RESTARTS   AGE
mypod   0/1     ErrImageNeverPull   0          42s
</code></pre>

sheng
<p>You need that image to be available in someplace. Normally this is done through a registry, but for local development, you can just upload your local image to your minikukbe cluster with the following command:</p>
<p><code>minikube image load image:tag</code></p>
<p>You may also want to check <code>minikube docker-env</code> which allows pointing your terminal docker-cli to the docker inside minikube in a simple way.</p>
