<p>Im trying to create a pod using my local docker image as follow.</p>

<p>1.First I run this command in terminal </p>

<pre><code>eval $(minikube docker-env)
</code></pre>

<p>2.I created a docker image as follow</p>

<pre><code>sudo docker image build -t my-first-image:3.0.0 .
</code></pre>

<p>3.I created the pod.yml as shown below and I run this command</p>

<pre><code>kubectl -f create pod.yml.
</code></pre>

<p>4.then i tried to run this command</p>

<pre><code>kubectl get pods
</code></pre>

<p>but it shows following error </p>

<pre><code>
NAME                                  READY   STATUS             RESTARTS   AGE
multiplication-6b6d99554-d62kk        0/1     CrashLoopBackOff   9          22m
multiplication2019-5b4555bcf4-nsgkm   0/1     CrashLoopBackOff   8          17m
my-first-pod                          0/1     CrashLoopBackOff   4          2m51
</code></pre>

<p>5.i get the pods logs</p>

<pre><code>kubectl describe pod my-first-pod 
</code></pre>

<pre><code>
Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  6m22s                  default-scheduler  Successfully assigned default/my-first-pod to minikube
  Normal   Pulled     5m20s (x4 over 6m17s)  kubelet, minikube  Successfully pulled image "docker77nira/myfirstimage:latest"
  Normal   Created    5m20s (x4 over 6m17s)  kubelet, minikube  Created container
  Normal   Started    5m20s (x4 over 6m17s)  kubelet, minikube  Started container
  Normal   Pulling    4m39s (x5 over 6m21s)  kubelet, minikube  pulling image "docker77nira/myfirstimage:latest"
  Warning  BackOff    71s (x26 over 6m12s)   kubelet, minikube  Back-off restarting failed container


</code></pre>

<pre><code>Dockerfile

    FROM node:carbon
    WORKDIR /app
    COPY . .
    CMD [ "node", "index.js" ]

</code></pre>

<pre><code>pods.yml

    kind: Pod
    apiVersion: v1
    metadata:
     name: my-first-pod
    spec:
     containers:
     - name: my-first-container
       image: my-first-image:3.0.0

</code></pre>

<pre><code>index.js

    var http = require('http');
    var server = http.createServer(function(request, response) {
     response.statusCode = 200;
     response.setHeader('Content-Type', 'text/plain');
     response.end('Welcome to the Golden Guide to Kubernetes
    Application Development!');
    });
    server.listen(3000, function() {
     console.log('Server running on port 3000');
    });

</code></pre>

<p>Try checking logs with command <code>kubectl logs -f my-first-pod</code></p>
