Georg Heiler
Georg Heiler

Reputation: 17676

docker beta on osx dns for links between containers not available

Yesterday I installed the docker-beata (https://beta.docker.com/) for osx. So far it seems great but the links defined between containers still do not to work out of the box, e.g their respective DNS name does not seem to be resolved.

How can I change this to make the dns-name of the linked container available on the (osx/ windows)host using docker-beta?

links:
      - someName

A pinata list returns the following, and a ping to docker.local fails with 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.

Described here with the old docker https://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.

but this no longer works, as the docker-beata runs already in hostnet

Upvotes: 2

Views: 911

Answers (1)

Plato
Plato

Reputation: 11052

I had this problem too, it seems to be fixed after disabling OS X firewall

I could swear I saw some documentation of an executable to whitelist instead of disabling the firewall, but I can't find it...

Upvotes: 1

Related Questions