docker osx 容器间链接的 dns 测试版不可用

docker beta on osx dns for links between containers not available

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

如何使用 docker-beta 更改此设置,使链接容器的 dns 名称在 (osx/ windows) 主机上可用?

links:
      - someName

A pinata list returns 以下,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.

这里用旧的描述dockerhttps://github.com/databricks/spark-integration-tests

With boot2docker, the Docker containers will be run inside of a VirtualBox VM, which creates some difficulties for communication between the Mac host and the containers. Follow these instructions to work around those issues:

Network access: Our tests currently run the SparkContext from outside of the containers, so we need both host <-> container and container <-> container networking to work properly. This is complicated by the fact that boot2docker runs the containers behind a NAT in VirtualBox.

One workaround is to add a routing table entry that routes traffic to containers to the VirtualBox VM's IP address:

sudo route -n add 172.17.0.0/16 boot2docker ip You'll have to re-run this command if you restart your computer or assign a new IP to the VirtualBox VM.

但这不再有效,因为 docker-beata 已经在主机网络中运行

我也有这个问题,禁用OS X 防火墙后似乎已修复

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