Environment

Next up, we have a few commands that display information about the virtual machine and also the environment that Minikube has configured on your device.

First, we have quite a simple command, minikube ip. All this command does is return the IP address of the virtual machine. This is useful if you want to interact with your cluster through a script. You can include the output of the command to reference your cluster's current IP address without having to hardcode the actual IP address into your scripts.

The next command we are going to look at is minikube docker-env. Running this command should print something like the following output to your screen:

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

What that output does is allow you (if you have it installed) to configure your local Docker client to communicate with the Docker installation on our Minikube virtual machine. There is, however, a downside to doing this. The version of Docker that is currently being distributed as part of the Minikube virtual machine image is a little behind the current release. You can see this by running eval $(minikube docker-env) and then docker version. When I ran the two commands, I got the following results:

$ eval $(minikube docker-env)
$ docker version
Client:
Version: 17.06.2-ce
API version: 1.23
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 20:12:06 2017
OS/Arch: darwin/amd64

Server:
Version: 1.12.6
API version: 1.24 (minimum version )
Go version: go1.6.4
Git commit: 78d1802
Built: Wed Jan 11 00:23:16 2017
OS/Arch: linux/amd64
Experimental: false

As you can see from the output, at the time of writing the version of Docker that Minikube is using is presently two versions behind my local installation of Docker for macOS, which is running the latest stable release. In the context of what we are covering in this book, running an older version of Docker is not a problem and nothing to worry about, as we will not be interacting with it directly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.20.224.107