Using a local image on minikube

  docker, minikube

I’m trying to use a local image on minikube. In order to build the image I run the following command

docker build -t goserver:1.0.0 .

My yaml file for minikube contains the following

apiVersion: apps/v1
kind: Deployment
metadata:
  name: goserver
  namespace: golang-ns
  labels:
    app: goserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: goserver
  template:
    metadata:
      labels:
        app: goserver
    spec:
      containers:
      - name: goserver
        image: goserver:1.0.0
        imagePullPolicy: Never
        ports:
        - containerPort: 8080

However when I try `kubectl apply -f ./k8s.yaml, I get the following error

Container image "goserver:1.0.0" is not present with pull policy of Never
Error: ErrImageNeverPull

I did a bit of searching and I found the following

How to use local docker images with Minikube?

And as per this I ran eval $(minikube docker-env), but I still get this error.

Is what I am trying to do possible or do I need to push this to docker hub?

Source: Docker Questions

LEAVE A COMMENT