Unable to deploy local container image to k8s cluster

I have tried to deploy one of the local container images I created but keeps always getting the below error

Failed to pull image “webrole1:dev”: rpc error: code = Unknown desc = Error response from daemon: pull access denied for webrole1, repository does not exist or may require ‘docker login’: denied: requested access to

I have followed the below article to containerize my application and I was able to successfully complete this but when I try to deploy it to k8s pod I don’t succeed

My pod.yaml looks like below

apiVersion: v1
kind: Pod
metadata:
  name: learnk8s
spec:
  containers:
  - name: webrole1dev
    image: 'webrole1:dev'
    ports:
      - containerPort: 8080

and below are some images from my PowerShell

I am new to dockers and k8s so thanks for the help in advance and would appreciate if I get some detailed response.

Hi Mohammad,

I think your problem is your container image is stored in local Docker daemon. But Minikube is running inside a VM so does not talk to that Docker Daemon. It’s trying to pull the image from Docker Hub.

Even if you had a full K8s cluster this is how it works, K8s needs access to the repo where your container image is stored. The images don’t get loaded from the users machine.

You can either push your image to docker hub and then pull it from there.
Or else setup a local docker registry, which I’m haven’t done so can’t give any suggestion.

Kind regards,
Stephen