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
openldap
service on the fly, it's clear that your needs are exeeding the opportunity of--link
feature. If you really need it, avoid the--link
and configure a full-featured service discovery.I will quote my own answer from the related question:
SkyDNSv1/SkyDock
);SkyDNS
makes 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
openldap
containers with a similair hostname, but forFlask
they will look like the same.