windowsdockerkubernetesgit-bashminikube

How to configure docker CLI to access docker server from minikube on Git-Bash?


I'm using a git bash integrated terminal on visual studio code on windows 10 pro. If a try this command eval $(minikube docker-env) I get bash: syntax error near unexpected token('`

Then I try eval '$(minikube docker-env)' and I get this error bash: You: command not found

If a try minikube docker-env I get

You can further specify your shell with either 'cmd' or 'powershell' with the --shell flag.

SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.0.164:2376
SET DOCKER_CERT_PATH=C:\Users\migue\.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

And finally if I try with REM @FOR /f "tokens=*" %i IN '('minikube docker-env')' DO @%i I get bash: REM: command not found


Solution

  • This is the configuration for the cmd.exe Shell provided by Windows. If you want to use bash, you can manually configure it. From your output it would look like:

    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST="tcp://192.168.0.164:2376"
    export DOCKER_CERT_PATH="C:\Users\migue\.minikube\certs"