— kubernetes, docker, minikube — 1 min read
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.
eval
the docker-env
to configure your shell to get started.1eval $(minikube docker-env)
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.1spec:2 containers:3 # This is for local use on minikube4 - image: nginx:201809195 name: nginx6 imagePullPolicy: IfNotPresent