为mac的docker指定ip地址 [英] specify ip address for docker for mac

查看:1176
本文介绍了为mac的docker指定ip地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Mac的Docker for Mac测试版,并从Spotlight中运行。

I'm using Docker for Mac Beta and it runs from spotlight.

有没有办法从控制台或强制运行使用任何配置文件来指定docker主机的ip地址。

Is there any way to run it from console or force to use any configuration file to specify ip address for docker host.

现在它从192.168.64.3变为192.168.64.5(每个起始码头可以有任何随机的IP)

Right now it changing from 192.168.64.3 to 192.168.64.5 (each start of docker it can have any random IP)

可能我需要配置桥接器?

probably I need to configure bridge interface?

com.docker.network.bridge.enable_ip_masquerade: true
com.docker.network.bridge.host_binding_ipv4: 0.0.0.0

有没有人知道如何做?

推荐答案

您可以通过unix套接字连接到Docker高山主机但我无法弄清楚如何桥接网络。

You can connect to the Docker alpine host via unix socket but I have not been able to figure out how to bridge to the network.

文档说:


不幸的是,由于OSX的限制, '不能r out of traffic
to container,and container从容器返回主机。

Unfortunately, due to limtations in OSX, we’re unable to route traffic to containers, and from containers back to the host.

由于在Docker for Mac中实现网络连接,您可以
请参见OSX中的docker0接口。这个界面实际上是HyperKit中的

Because of the way networking is implemented in Docker for Mac, you cannot see a docker0 interface in OSX. This interface is actually within HyperKit.

这篇关于为mac的docker指定ip地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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