Using the Docker registry

How to access the Docker registry within minikube

As an alternative to reusing the Docker daemon, you may enable the registry addon to push images directly into registry.

Steps are as follows:

For illustration purpose, we will assume that minikube VM has one of the ip from subnet. If you have not overridden these subnets as per networking guide, you can find out default subnet being used by minikube for a specific OS and driver combination here which is subject to change. Replace with appropriate values for your environment wherever applicable.

Ensure that docker is configured to use as insecure registry. Refer here for instructions.

Ensure that is enabled as insecure registry in minikube. Refer here for instructions..

Enable minikube registry addon:

minikube addons enable registry

Build docker image and tag it appropriately:

docker build --tag $(minikube ip):5000/test-img .

Push docker image to minikube registry:

docker push $(minikube ip):5000/test-img

Now run it in minikube:

kubectl run test-img --image=$(minikube ip):5000/test-img

Or if is not enabled as insecure registry in minikube, then:

kubectl run test-img --image=localhost:5000/test-img