5 ms·
My main problem with Docker is that container IP addresses and MACs are changed after every container reboot. This means I can't have a database in one containe
by jahewson 13y ago
My main problem with Docker is that container IP addresses and MACs are changed after every container reboot. This means I can't have a database in one container and a web app in another because I have no way for the web app to discover the address of the database server.
Seems like this would be an issue for the host-only (private) network?
- cr4zy 13y agoThis could be solved on AWS with Elastic IP's or OpenStack environments with Floating IP's. Adding this to Docker would be a nice way to allow new machines to be created but to keep the same IP with automatic switchover.
- shykes 13y agoThere has been some work around integrating docker iwth Openstack floating IPs already. Check out http://github.com/dotcloud/openstack-docker http://github.com/dotcloud/openstack-docker
- progrium 13y agoDocker is in very active development and issues like this get resolved every week. That said, it's not a problem because of the service discovery and routing that would be involved in the Flynn system.
- jahewson 13y agoYes, Docker is moving quickly but one barrier to resolving this is philosophical: static IPs and private networks are un-Dockerish. Right now it's not obvious what a clean solution would look like. I'd be keen to see how Flynn's discovery and routing develops, it sounds very promising.
- ascendantlogic 13y agoSounds like a job for some dynamic DNS. That's exactly the sort of thing it's supposed to solve for.
- shykes 13y agoStatic IPs and private networks are not particularly un-Dockerish. They are just not the default implemented by Docker :) Docker 1.0 will include an API which will make it much easier to customize how you want networking to happen. That includes static IPs and private networks. Note that the 1.0 API will also include hooks for service discovery - specifically to facilitate the development of projects like Flynn.
- tristanz 13y agoAre these feature plans documented somewhere? Private networks, in the spirit of EC2 security groups or VPCs, would help simplify many distributed computing scenarios where securing services with passwords isn't an option.
- igorw 13y agoWithout knowing too much about docker, service discovery over dns-sd and potentially mdns (aka bonjour/zeroconf) generally works quite well in a contained private network. And I would love to see a platform that supports it.
- sp332 13y agoWhy doesn't it work to use the hostname of the database server, instead of the IP address?
- alecthomas 13y agoIn dynamic clusters like Flynn this could be solved with a naming service. Typically this will be implemented on top of something like Zookeeper or Doozer. Another option could be to use Go DNS [1] to integrate a DNS server directly into the cluster. This would allow the DNS records to immediately reflect the state of the cluster, using SRV records to map directly to the dynamically allocated hosts + ports. DNS resolver caching would have to be carefully managed though. I have no idea whether there any plans to implement a naming service on top of Flynn. [1] https://github.com/miekg/dns https://github.com/miekg/dns