I am running a flask application & with Openldap as the server. I need to add & delete links in running flask app container to openldap container. Basically I gave the link to openldap at runtime in flask app container. Now I want to add & delete openldap containers as I please & link them to flask application container without restarting it.
I am running the containers on boot2docker with docker-machine on Ubuntu 14.04.
While it's still not clear why do you want to replace the
openldapservice on the fly, it's clear that your needs are exeeding the opportunity of--linkfeature. If you really need it, avoid the--linkand configure a full-featured service discovery.I will quote my own answer from the related question:
SkyDNSv1/SkyDock);SkyDNSmakes the containers know each other by name, but the host is not aware of it);--hostname(you will probably use schemecontainer_name.image_name.dev.skydns.local).You will be able to start and stop different
openldapcontainers with a similair hostname, but forFlaskthey will look like the same.