官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 通海县| 多伦县| 鸡泽县| 弋阳县| 红河县| 绥中县| 武威市| 丹江口市| 葫芦岛市| 太白县| 邛崃市| 安福县| 吴桥县| 易门县| 连山| 许昌市| 满城县| 丽江市| 承德县| 保德县| 石河子市| 广元市| 江华| 长春市| 龙泉市| 井研县| 黔西县| 邯郸县| 分宜县| 方城县| 肇庆市| 青海省| 安义县| 乐陵市| 长乐市| 万山特区| 肥乡县| 陇南市| 张家口市| 壶关县| 曲松县|