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

5/12/2019

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

-- Miguel Ángel Torres
docker
git-bash
kubernetes
minikube
windows

2 Answers

5/12/2019

try this Command and I think it will work

eval '(minikube docker-env)'

try to check minikube environment variable using

$ printenv 

if not there try to set the environment variable for minikube

-- Kirti Azad
Source: StackOverflow

5/12/2019

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"
-- Thomas
Source: StackOverflow