Problems after running minikube docker-env

My environment is MacOS Big Sur 11.6.1 installed minikube with hyperkit driver but when I attempt to use the docker environment it doesn’t seem to work and I tried the following iterations:

pwstephe@pwstephe-mac ~ % minikube start
:smile: minikube v1.24.0 on Darwin 11.6.1
:black_small_square: MINIKUBE_ACTIVE_DOCKERD=minikube
:sparkles: Using the hyperkit driver based on existing profile
:+1: Starting control plane node minikube in cluster minikube
:arrows_counterclockwise: Restarting existing hyperkit VM for “minikube” …
:whale: Preparing Kubernetes v1.22.3 on Docker 20.10.8 …
:mag_right: Verifying Kubernetes components…
:black_small_square: Using image Google Cloud console
:black_small_square: Using image kubernetesui/dashboard:v2.3.1
:black_small_square: Using image kubernetesui/metrics-scraper:v1.0.7
:star2: Enabled addons: storage-provisioner, default-storageclass, dashboard
:surfing_man: Done! kubectl is now configured to use “minikube” cluster and “default” namespace by default

pwstephe@pwstephe-mac ~ % minikube docker-env
export DOCKER_TLS_VERIFY=“1”
export DOCKER_HOST=“tcp://192.168.64.2:2376”
export DOCKER_CERT_PATH=“/Users/pwstephe/.minikube/certs”
export MINIKUBE_ACTIVE_DOCKERD=“minikube”

To point your shell to minikube’s docker-daemon, run:

eval $(minikube -p minikube docker-env)

pwstephe@pwstephe-mac ~ % eval $(minikube -p minikube docker-env)
pwstephe@pwstephe-mac ~ % docker ps
zsh: command not found: docker

pwstephe@pwstephe-mac ~ % minikube docker-env --shell zsh
export DOCKER_TLS_VERIFY=“1”
export DOCKER_HOST=“tcp://192.168.64.2:2376”
export DOCKER_CERT_PATH=“/Users/pwstephe/.minikube/certs”
export MINIKUBE_ACTIVE_DOCKERD=“minikube”

To point your shell to minikube’s docker-daemon, run:

eval $(minikube -p minikube docker-env)

pwstephe@pwstephe-mac ~ % eval $(minikube docker-env --shell zsh)
pwstephe@pwstephe-mac ~ % docker ps
zsh: command not found: docker

pwstephe@pwstephe-mac ~ % minikube docker-env --shell bash
export DOCKER_TLS_VERIFY=“1”
export DOCKER_HOST=“tcp://192.168.64.2:2376”
export DOCKER_CERT_PATH=“/Users/pwstephe/.minikube/certs”
export MINIKUBE_ACTIVE_DOCKERD=“minikube”

To point your shell to minikube’s docker-daemon, run:

eval $(minikube -p minikube docker-env)

pwstephe@pwstephe-mac ~ % eval $(minikube docker-env --shell bash)
pwstephe@pwstephe-mac ~ % docker ps
zsh: command not found: docker
pwstephe@pwstephe-mac ~ %

Do you have docker cli installed on your mac?? Try using minikube ssh , it should ssh into your node, then you can use docker ps

I uninstalled the Mac Docker Desktop, (license issue, memory and cpu hog), because it appeared to me that minikube had a Docker environment already but I never go this to work. I then installed:

  • brew install docker
  • brew install docker-compose

and of course that does work but it makes me wonder what the minkube docker environment really refers to?

It’s no longer necessary to run any of the commands below related to docker environment to get docker to work since it’s a separate install.

eval $(minikube -p minikube docker-env) install from minikube.

What am I missing in the relationship between a docker install and minikube docker environment?

Thanks,
Phil

It’s a matter of separating the docker engine from the docker built-in that comes with minikube.

You can run Docker as a standalone container engine, by this you may use docker cli like docker ps,
However, if you run minikube, then the new containers used for minikube pods will be deployed under the minikube virtual node, so if you want to control the docker-engine used for the virtual node for minikube, then you should for the command you tried above or ssh to the minikube like mentioned in my reply above.

If you want to use docker without minikube, then you can use docker cli directly without playing with system env.

Thanks for the reply.

I see, Minicube implemented Docker in the Hyperkit vm and the only way to get to a docker CLi is through minicube ssh. Looking at other documentation it appeared that I would be able access Docker from the host machine CLI which for me is MacOS.

When I installed Docker on MacOS of course I was able to run Docker natively on the MacOS CLI, independent of minikube which made me beg the question thinking that minkube docker would be exposed by running minikube docker-env. but it appears if I want to interface directly to Docker it has to be via minikube ssh so I still wonder what minikube-env would do.

Thanks,
Phil