Docker机器如何标记为活动? [英] How is a Docker Machine marked as active?

查看:132
本文介绍了Docker机器如何标记为活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Docker Machine用户指南,在 https://docs.docker.com/v1.5 / machine /



它说:

 您可以通过再次运行docker-machine ls命令来查看您创建的计算机:

$ docker-machine ls
名称ACTIVE DRIVER STATE URL
dev * virtualbox运行tcp: //192.168.99.100:2376

dev旁边的*表示它是活动主机。

当我运行这个我没有看到任何机器旁边的*。我需要做什么才能使机器被标记为活动的?有没有任何好处?



例如,我在Windows 10上运行Docker Machine,通过使其处于活动状态,这意味着我不必继续指定我的命令中的机器名称,如 docker-machine env dev

解决方案

我认为只运行以下命令应该可以工作:

  $ eval $(docker-machine env default)

(其中默认是机器的名称) p>

*的原因是告诉您当前连接的机器,例如如果您运行的Docker引擎将要与其通信的 docker ps



在当前版本的Docker机器中,相信您必须始终指定名称。


I am working through the Docker Machine User Guide over at https://docs.docker.com/v1.5/machine/.

It says:

You can see the machine you have created by running the docker-machine ls command again:

  $ docker-machine ls
  NAME      ACTIVE   DRIVER       STATE     URL
  dev       *        virtualbox   Running   tcp://192.168.99.100:2376

The * next to dev indicates that it is the active host.

When I run this I don't see the * next to any machines. What do I need to do to make the machine be marked as active? Are there any benefits to this?

For example, I am running the Docker Machine on Windows 10, by making it active does it mean I don't have to keep specifying the machine name in my commands such as docker-machine env dev

解决方案

I think just running the following command should work:

$ eval $(docker-machine env default)

(Where default is the name of the machine).

The reason for the * is to tell you which machine you're currently connected to e.g. if you run docker ps which Docker engine will it talk to?

In the current version of Docker machine, I believe you have to always specify the name.

这篇关于Docker机器如何标记为活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆