Locally built container images cannot be pulled on Windows 10

I am using Windows 10 and install minikube. Minikube installation is successful. First I build Docker image locally with below Dockerfile

FROM openjdk:11-jdk
ADD target/Spring-Blog-Jpa-0.0.1-SNAPSHOT.jar blog-app.jar
EXPOSE 8080
ENTRYPOINT ["java","-Dfile.encoding=UTF8","-jar","blog-app.jar"]

docker build --tag blogapp:latest .

Image is built successfully and I can find the locally built Docker images:

> docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
blogapp             latest              edab367fd20b        8 seconds ago       5.22GB

Then I try to make minikube pod with this image. The below is yaml file.

apiVersion: v1
kind: Pod
metadata: 
  name: blog-app
spec: 
  containers:
  - name: blog-app
    image: blogapp:latest
    imagePullPolicy: Always
    ports:
    - containerPort: 8080

But I cannot make Pod with the above yaml file. The log shows that the image cannot be pulled. The image is not registered on local Docker repository? If true, how can the locally built Docker image be used on Kubernetes on Windows 10?

Are you using the instance of docker within minikube? or on the host? minikube itself is a VM and has a separate instance of docker and the container will need to either be built with that or exported / imported.

You can setup your local system to use the minikube docker instance – check out the info here:

Thank you for your reply. When I pull the image from official docker hub(ex: mysql), the pod is generated successfully. But the locally built image(ex:blogapp) will not be pulled and throw errors.

It should build within the minikube VM after executing the $(minikube docker-env) instead of on the host instance of docker, you can also save the image with docker save and import it into the minikube vm.