How to Use Own Local Docker Images With Minikube

A step by step guide with an example project

Bhargav Bachina
Bachina Labs

--

Photo by Clem Onojeghuo on Unsplash

We often have this problem while working with minikube on your local machine where minikube not able to find local docker images. When we install minikube it runs on his own virtual machine and when we run the deployment and it always pulls the Docker images from public or private docker registry.

In this post, we will see how we can use local docker images instead of pulling from the docker registries, for example, docker hub, etc.

  • Example Project
  • Problem We Are Facing
  • Solution
  • Implementation
  • Summary
  • Conclusion

Example Project

Here is an example project for this post. This is a simple nodejs express app serving on port 3000 and it has the Dockerfile as well to build the image.

// clone the project
git clone https://github.com/bbachi/local-minikube-docker.git
// install and run the project
npm install
npm start
// build the docker image
docker build -t nodejs-api .

Here is the simple nodejs server running on 3000 which returns hello world on path /

--

--