Cannot access docker hub after eval of minikube docker env?

8/10/2018

I am really confused, I had being learning kubernetes with minikube creating services and other things.

The problem comes in the following shape:

I run the following commands after a fresh install of minikube:

eval $(minikube docker-env)

The reason is because I want to get an image from my computer to be used with minikube. My understanding is that with this command I am in the same context for minikube and docker, so I can access my local images. "Please correct me if I am wrong here".

minikube start

So I get up and running the cluster, and ready to start creating things.

I want to pull the following container:

docker pull nginx/nginx-ingress

Because I want to try an ingress controller to work with my services.

But then I get this weird message:

Using default tag: latest Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon at tcp://192.168.99.101:2376. Is the docker daemon running?). Using system default: https://index.docker.io/v1/ Cannot connect to the Docker daemon at tcp://192.168.99.101:2376. Is the docker daemon running?

I run:

docker ps

And no results with a hang out.

I go to another terminal, I run the docker ps and it works like a charm.

Please if someone can bring some light to me of the impact of the command:

eval $(minikube docker-env)

And if you know why in my current Term with minikube running cannot access to my docker machine would help a lot.

-- juan garcia
docker
kubernetes
kubernetes-ingress
minikube

1 Answer

8/10/2018

minikube starts a dedicated virtual machine as a single-node Kubernetes cluster. If you have other Docker environments (a separate Docker Machine VM, the Docker Toolbox VM, the Docker for Mac or Docker for Windows environments, or a Linux-native Docker) these are separate from the Docker in the VM. You can't share images or containers between these environments.

If you have private images that aren't published to a registry, you'll have to re-docker build them when you switch to the Minikube environment. You otherwise don't specifically have to docker pull things that you're using, when you reference them in a Kubernetes pod spec Kubernetes will pull them for you.

-- David Maze
Source: StackOverflow