DEV Community

Kunal Parikh
Kunal Parikh

Posted on

Docker on macOS via minikube with support for corporate proxies with custom certificate authority

# Set proxy
export HTTPS_PROXY='host:port'
export https_proxy=$HTTPS_PROXY
export http_proxy=$HTTPS_PROXY
export NO_PROXY='localhost,,,,,,'
export no_proxy=$NO_PROXY

# Add Custom Root CAs to
mkdir -p ~/.minikube/certs
# cp /path/to/custom.pem ~/.minikube/certs

# Install
brew install hyperkit
brew install minikube

# Start minikube
minikube start --embed-certs --container-runtime=docker --driver=hyperkit --docker-env HTTP_PROXY=$HTTP_PROXY --docker-env HTTPS_PROXY=$HTTPS_PROXY --docker-env NO_PROXY=$NO_PROXY --docker-env http_proxy=$http_proxy --docker-env https_proxy=$https_proxy --docker-env no_proxy=$no_proxy

# Add minikube's ip to the no proxy list
export NO_PROXY=`minikube ip`,$NO_PROXY
export no_proxy=$NO_PROXY

# Set up Docker
curl -L | tar -xz  --strip-components=1 -C /usr/local/bin docker/docker
eval $(minikube -p minikube docker-env)
Enter fullscreen mode Exit fullscreen mode

Discussion (0)