<div dir="ltr">I've published the new one<div><br></div><div><a href="https://github.com/muayyad-alsadi/docker-glue">https://github.com/muayyad-alsadi/docker-glue</a><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 28, 2015 at 3:52 PM, Muayyad AlSadi <span dir="ltr"><<a href="mailto:alsadi@gmail.com" target="_blank">alsadi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>hi,</div><div><br></div><div>inspired by /usr/bin/atomic usage of container labels < <a href="http://www.projectatomic.io/docs/usr-bin-atomic/" target="_blank">http://www.projectatomic.io/docs/usr-bin-atomic/</a></div><div><br></div><div>I wrote a simple python script < <a href="https://github.com/muayyad-alsadi/docker-balancer" target="_blank">https://github.com/muayyad-alsadi/docker-balancer</a></div><div><br></div><div>that reconfigure haproxy to route http requests based on host to containers having the corresponding labels (or env variable) and load-balancer them</div><div><br></div>docker run -d -name my_wp_1 -l container_host=<a href="http://wordpress.example.com" target="_blank">wordpress.example.com</a> wordpress<div>docker run -d -name my_wp_2 -l container_host=<a href="http://wordpress.example.com" target="_blank">wordpress.example.com</a> wordpress<br><div>docker run -d -name my_wp2 -e container_host=<a href="http://wordpress2.example.com" target="_blank">wordpress2.example.com</a> wordpress<br></div><div><br></div><div>I actually have a systemd service mycontainer@.service (as in mycontainer@myapp_1 where I strip _number to allow launching multiple containers for the same app) which I use to run and pass those labels from /etc/sysconfig/mycontainer/myapp.rc</div><div><br></div><div>I'm planning to extend the functionality of this script (called docker-glue) to support any http port</div></div><div><br></div><div>docker run -d -name wp1 -l glue_http_80_host=<a href="http://wordpress.example.com" target="_blank">wordpress.example.com</a> wordpress<br></div><div>docker run -d -name wp1 -l glue_http_80_host=<a href="http://openstack.example.com" target="_blank">openstack.example.com</a> -l glue_http_80_prefix='dashboard/' horizonĀ <br></div><div><div>docker run -d -name wp1 -l glue_http_80_host=<a href="http://openstack.example.com" target="_blank">openstack.example.com</a> -l glue_http_80_prefix='identity/' keystone<br></div></div><div><br></div><div>most likely I'll strip the prefix unless glue_http_80_strip_prefix=0 is passed</div><div><br></div><div>I believe this will help in openstack kolla and many other projects.<br></div><div><br></div><div>my docker glue has a modular plugins to do various things (ex. attach docker to openvswitch or publish docker inspect to etcd ..etc.)</div><div><br></div><div>I would like to hear suggestions from you</div><div><br></div></div>
</blockquote></div><br></div>