Using Minikube with Local Docker Images

duffn
Sep 29, 2018

When developing locally with Minikube, you may want to use locally built Docker images instead of images hosted in a registry. Why push images up to Google’s GCR or AWS ECR if you’re only testing locally? Thankfully, this is simple with only a few steps.

  • With Minikube running, eval the docker-env to configure your shell to get started.
  • Build your image.
  • In the containers specification of your deployment, use the locally built image and specify the imagePullPolicy. Setting this policy to IfNotPresent tells Kubernetes to use a local image preferentially.
  • Apply the deployment and that’s it! You have a locally built image running in Minikube on your machine.

--

--

duffn

I write about Python, Go, Node.js, cloud infrastructure, and data. https://duffn.github.io