osx dns上的docker beta,用于不可用的容器之间的链接

时间:2016-05-06 13:31:35

标签: macos docker dns docker-compose

昨天我为osx安装了docker-beata(https://beta.docker.com/)。到目前为止它似乎很好,但容器之间定义的链接仍然没有开箱即用,例如它们各自的DNS名称似乎没有得到解决。

如何更改此设置以使用docker-beta在(osx / windows)主机上提供链接容器的dns-name?

links:
      - someName

pinata list会返回以下内容,pingdocker.local会因unknown host

而失败
  hostname = docker
   Hostname of the virtual machine endpoint, where container ports will be
   exposed if using nat networking. Access it via 'docker.local'.

  hypervisor = native (memory=8, ncpu=4)
   The Docker.app includes embedded hypervisors that run the virtual machines
   that power the containers. This setting allows you to control which the
   default one used for Linux is.

 ▸  native: a version of the xhyve hypervisor that uses the MacOSX
              Hypervisor.framework to run container VMs. Parameters:
              memory (VM memory in gigabytes), ncpu (vCPUs)


  network = hostnet (docker-ipv4=192.168.65.2, host-ipv4=192.168.65.1)
   Controls how local containers can access the external network via the
   MacOS X host. This includes outbound traffic as well as publishing ports
   for external access to the local containers.

 ▸ hostnet: a mode that helps if you are using a VPN that restricts
              connectivity. Activating this mode will proxy container network
              packets via the Docker.app process as host socket traffic.
              Parameters: docker-ipv4 (docker node), host-ipv4 (host node)
 ▸     nat: a mode that uses the MacOS X vmnet.framework to route container
              traffic to the host network via a NAT. 

  filesystem = osxfs 
   Controls the mode by which files from the MacOS X host and the container
   filesystem are shared with each other.

 ▸   osxfs: a FUSE-based filesystem that bidirectionally forwards OSX
              filesystem events into the container. 


  native/port-forwarding = true 
   Expose container ports on the Mac, rather than the VM

 ▸    true: Container ports will be exposed on the Mac 
 ▸   false: Container ports will be exposed on the VM 

  daemon = run 'pinata get daemon' or 'pinata set daemon [@file|-]>
   JSON configuration of the local Docker daemon. Configure any custom
   options you need as documented in:
   https://docs.docker.com/engine/reference/commandline/daemon/. Set it
   directly, or a @file or - for stdin.

这里用旧的码头https://github.com/databricks/spark-integration-tests

描述
  

使用boot2docker,Docker容器将在一个内部运行   VirtualBox VM,这会给通信带来一些困难   Mac主机和容器之间。请按照以下说明操作   解决这些问题:

     

网络访问:我们的测试目前从外部运行SparkContext   容器,所以我们需要主机< - >容器和容器   < - >容器网络正常工作。这很复杂   事实上,boot2docker在VirtualBox中运行NAT后面的容器。

     

一种解决方法是添加路由表条目以将流量路由到   容器到VirtualBox VM的IP地址:

     

sudo route -n add 172.17.0.0/16 boot2docker ip您必须这样做   如果重新启动计算机或分配新IP,请重新运行此命令   VirtualBox VM。

但这不再有效,因为docker-beata已在hostnet中运行

1 个答案:

答案 0 :(得分:1)

我也遇到了这个问题,似乎在禁用OS X防火墙后修复了

我可以发誓我看到了一些可执行文件的白名单文档而不是禁用防火墙,但我找不到它......