<p>I have a docker image called docker-hello-world - all it does is print Hello World to the log using the JRE.  When tested it works fine.</p>

<p>Then, I import an image into Kubernetes Docker and run – still no issues.</p>

<pre><code>docker images -a
REPOSITORY                                             TAG                 IMAGE ID            CREATED             SIZE
docker-hello-world                                     latest              9a161d166742        20 hours ago        83.17 MB
</code></pre>

<ol start="3">
<li>When I try and deploy into Kubernetes with <code>kubectl run docker-hello-world --image=docker-hello-world:latest</code>  something goes wrong here – I tried the image id as well but I can’t understand why it can’t find the image.</li>
</ol>

<p>It says deployment created.</p>

<pre><code>kubectl get deployments
NAME                 DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
docker-hello-world   1         1                1                   0           24s

kubectl get pods
NAME                                                READY     STATUS         RESTARTS   AGE
docker-hello-world-67c745cff4-sv77d   0/1       ErrImagePull   0          43s
</code></pre>

<p>Logs:</p>

<pre><code>kubectl logs docker-hello-world-67c745cff4-sv77d
Error from server (BadRequest): container "docker-hello-world" in pod "docker-hello-world-67c745cff4-sv77d" is waiting to start: trying and failing to pull image
</code></pre>

<p>Im not sure why it can’t find the image.</p>

<p>But if I do from within Minikube:</p>

<pre><code>docker build -t dummy:v1 ~/eclipse-workspace/HelloWorld/bin/  
</code></pre>

<p>(I don’t really want do generate the image again)</p>

<pre><code>docker images
REPOSITORY                                             TAG                 IMAGE ID            CREATED             SIZE
dummy                                                  v1                  beae3bfd2327        32 seconds ago      83.17 MB

kubectl run --image=dummy:v1 dummy
deployment "dummy” created

kubectl get deployments
NAME           DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
dummy          1                1           1                   0           11s

kubectl get pods
NAME                            READY     STATUS      RESTARTS   AGE
dummy-8496dd7d84-t4h66          0/1       Completed   4          1m

kubectl logs dummy-8496dd7d84-t4h66
Hello, World
</code></pre>

<p>It seems to work ok</p>

<p>The version tag of the image <code>docker-hello-world:latest</code> is <code>latest</code>, which indicates the default <code>ImagePullPolicy</code> is <code>Always</code> (see <code>pkg/apis/core/v1/defaults.go</code> for v1.9.x and after). It will try to pull image from the hub and not use the image already present.</p>

<p>One option is set a specific tag rather than <code>latest</code>.</p>
