Docker的这个命令作用是什么?
迷茫
迷茫 2017-04-24 09:10:02
0
2
646
$eval "$(docker-machine env --swarm swarm-master)"

上面这个命令的中文解释是:“把当前环境变量配置到shell中”。
可是没听懂,麻烦解释一下什么意思?起什么作用?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
洪涛

The execution results of docker-machine env are as follows:

$ docker-machine env default
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="Y:\Users\YSTYLE\.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $("D:\Programming\Docker Toolbox\docker-machine.exe" env default)

Parameter --swarm swarm-master indicates that this docker is a swarm cluster

The function of

eval is to parse the text into a script and then execute it. Here, the results similar to the above are executed, just setting a few environment variables

The local docker cli actually sends instructions to damon through remote tcp.
The specific machine being operated is specified by the environment variable DOCKER_HOST, which is 127.0.0.1:2375 when empty

小葫芦

baidu docker

There are many questions like this
It’s not as fast as searching for them by yourself

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template