Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set docker environment variables from minikube #25

Merged
merged 1 commit into from
Nov 19, 2019

Conversation

mvgijssel
Copy link
Member

Setting the docker environment variables from minikube using function

eval $(minikube docker-env)

allows the docker cli tool to communicate with the docker daemon inside of minikube.

The output of the function looks like

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.64.1:2376"
export DOCKER_CERT_PATH="~/.minikube/certs"
# Run this command to configure your shell:
# eval $(minikube docker-env)

Hardcoding the docker environment variables is problematic, due to the DOCKER_HOST ip changing as hardcoded ip's are not supported (yet) kubernetes/minikube#951.

The minikube start command does not set the docker env as well, so created a wrapper method mkube which writes and sources the current docker environment to .dockerenv.

@mvgijssel mvgijssel added the enhancement New feature or request label Nov 19, 2019
@mvgijssel mvgijssel merged commit c70ca7e into master Nov 19, 2019
@mvgijssel mvgijssel deleted the feature/set-minikube-docker-environment branch November 19, 2019 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant