search

Home  >  Q&A  >  body text

Docker的这个命令作用是什么?

$eval "$(docker-machine env --swarm swarm-master)"

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

迷茫迷茫2771 days ago645

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-24 09:12:02

    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

    reply
    0
  • 高洛峰

    高洛峰2017-04-24 09:12:02

    baidu docker

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

    reply
    0
  • Cancelreply