title: How to use Local docker image in kubernetes via kubectl
body: <p>I created customize Docker Image and stored in my local system Now I want use that Docker Image via kubectl .</p>
  
  <p>Docker image:-
  1:- docker build -t backend:v1 .</p>
  
  <p>Then Kubernetes file:-</p>
  
  <pre><code>apiVersion: apps/v1beta1
  kind: Deployment
  metadata:
    creationTimestamp: null
    labels:
      app: backend
    namespace: web-console
  spec:
    replicas: 1
    strategy: {}
    template:
      metadata:
        creationTimestamp: null
        labels:
          app: backend
      spec:
        containers:
        - env:
          - name: mail_auth_pass
          - name: mail_auth_user
          - name: mail_from
          - name: mail_greeting
          - name: mail_service
          - name: mail_sign
          - name: mongodb_url
            value: mongodb://mongodb.mongodb.svc.cluster.local/console
          - name: server_host
            value: "0.0.0.0"
          - name: server_port
            value: "3000"
          - name: server_sessionSecret
            value: "1234"
            image: backend
            imagePullPolicy: Never
          name: backend
          resources: {}
        restartPolicy: Always
  status: {}```
  
  Command to run kubectl:- kubectl create -f  backend-deployment.yaml
  
  **getting Error:-** 
  error: error validating "backend-deployment.yaml": error validating data: [ValidationError(Deployment.spec.template.spec.containers[0].env[9]): unknown field "image" in io.k8s.api.core.v1.EnvVar, ValidationError(Deployment.spec.template.spec.containers[0].env[9]): unknown field "imagePullPolicy" in io.k8s.api.core.v1.EnvVar]; if you choose to ignore these errors, turn validation off with --validate=false
  </code></pre>