#!/usr/bin/env sh # A wrapper for interacting with minikube. # # Example: # :; bin/mkube docker image ls # If we're running under WSL then we have to use the Windows native Minikube # as the Linux version doesn't work in WSL. Assume WSL is Microsoft's only # Linux distro. if ! uname -r | grep Microsoft > /dev/null; then MINIKUBE_EXE=minikube else # This is where minikube-installer.exe puts it. MINIKUBE_EXE="${MINIKUBE_EXE:-/mnt/c/Program Files (x86)/Kubernetes/Minikube/minikube.exe}" fi # Rewrite Windows style paths "C:\\whatever\\whatever" to "/mnt/c/whatever/whatever". eval "$("${MINIKUBE_EXE}" docker-env --shell=bash | sed 's|C:\\|/mnt/c/|g;s|\\|/|g')" exec "$@"