Unable to open the docker shell on minicube

8/27/2018

I am running minikube instance on window 10 machine. I've tried to open the docker shell, but docker wasn't recognized in the cmd.

C:\tools\cloud>.\minikube.exe docker-env --shell cmd
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://172.27.61.204:2376
SET DOCKER_CERT_PATH=C:\Users\sswain\.minikube\certs
SET DOCKER_API_VERSION=1.35
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('minikube docker-env') DO @%i

As the instruction specifies I again run the command provided in the instruction.

C:\tools\cloud>REM @FOR /f "tokens=*" %i IN ('minikube docker-env') DO @%i    
C:\tools\cloud>

It didn't open the docker shell.

-- Soumyajit Swain
docker
kubernetes
minikube

1 Answer

8/28/2018

The commands you get from minikube.exe docker-env --shell cmd does not start any shell, but they configure your Docker CLI to access Docker from Minikube.

In my case, I tried CMD with the following:

C:\Users\rafal>minikube.exe docker-env --shell cmd
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.0.24:2376
SET DOCKER_CERT_PATH=C:\Users\rafal\.minikube\certs
SET DOCKER_API_VERSION=1.35
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('minikube docker-env') DO @%i

After executing all the commands above, I could access the Docker Engine with Docker CLI.

C:\Users\rafal>docker ps
CONTAINER ID        IMAGE                                      COMMAND                  
CREATED              STATUS              PORTS               NAMES
9736b43b6cd5        k8s.gcr.io/k8s-dns-sidecar-amd64           "/sidecar --v=2 --lo…"   
About a minute ago   Up About a minute                       k8s_sidecar_kube-dns- 
86f4d74b45-pb6k7_kube-system_0da3947c-aa9d-11e8-8305-00155d395166_0
3640c6aa2e73        k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64     "/dnsmasq-nanny -v=2…"   
About a minute ago   Up About a minute                       k8s_dnsmasq_kube-dns- 
86f4d74b45-pb6k7_kube-system_0da3947c-aa9d-11e8-8305-00155d395166_0
...

Note that minikube.exe must be on your env PATH, since otherwise 'minikube docker-env' may not be executed correctly.

-- Rafał Leszko
Source: StackOverflow