Docker – running mesos-master in docker container – cannot see containers IP from other hosts

apache-mesoscoreosdocker

I have a question.

I am running mesos-master as docker container. When I start it, it writes its IP to zookeeper, so any slave running on same host can connect to mesos master. Mesos-master is not accessible from any other host.
Mesos-master port is available on host public IP by docker port expose
I cannot run mesos-master in container with hosts public IP, because it cannot listen on ip it doesn't have

Is there any way I could propagate to zookeeper –ip=(containers local IP) and –public-ip=(hosts IP which will be propagated to zookeeper)

One solution that came to my mind was using some proxy as described by CoreOS guys here: http://coreos.com/blog/docker-dynamic-ambassador-powered-by-etcd/
But I would like to solve it elegantly with changing IP in zookeeper.

I've my docker and unit files saved here: https://github.com/veverjak/coreos-mesos-marathon

Did anyone try this?

Best Answer

Easiest solution that I've found is using hosts IP addresses in container.

Docs are here

I've implemented it this way.