{"id":13557929,"url":"https://github.com/jwilder/docker-discover","last_synced_at":"2025-03-17T07:31:44.022Z","repository":{"id":18621208,"uuid":"21826959","full_name":"jwilder/docker-discover","owner":"jwilder","description":"Service discovery for docker container","archived":false,"fork":false,"pushed_at":"2016-06-15T19:24:48.000Z","size":16,"stargazers_count":210,"open_issues_count":7,"forks_count":63,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-02-27T19:59:04.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwilder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-14T16:35:57.000Z","updated_at":"2024-09-02T20:20:17.000Z","dependencies_parsed_at":"2022-09-11T17:00:37.383Z","dependency_job_id":null,"html_url":"https://github.com/jwilder/docker-discover","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fdocker-discover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fdocker-discover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fdocker-discover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilder%2Fdocker-discover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwilder","download_url":"https://codeload.github.com/jwilder/docker-discover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243852433,"owners_count":20358267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:04:37.748Z","updated_at":"2025-03-17T07:31:43.737Z","avatar_url":"https://github.com/jwilder.png","language":"Python","funding_links":[],"categories":["Python","others"],"sub_categories":[],"readme":"docker-discover is a service discovery container that leverages haproxy and etcd.  When running,\nit sets up listeners for remote docker containers discovered via etcd.  It works in tandem with\ndocker-register.\n\nTogether, they implement [service discovery][2] for docker containers with a similar architecture\nto [SmartStack][3].  docker-discovery is analagous to [synapse][4] in the SmartStack system.\n\nSee also [Docker Service Discovery Using Etcd and Haproxy][5]\n\n### How it works\n\nWhen running, the container will setup ports on the host that can be accessed from other locally\nrunning containers.  For example, host port 5000 would forward requests to remote hosts running\ncontainers that `EXPOSE` port 5000.  Each proxied service port is monitored with basic TCP health\nchecks and will be re-dispatched if backend container fails.  This ensure that backend containers\ncan be started and stopped as needed w/ minimal client impact.\n\nThe intent is that you would run this container on any host that has containers that need to call\nremote services in your infrastructure.\n\nFrom within a container on a host running docker-discover, they can reach remote containers by hitting\nthe docker bridge IP or the host IP and the corresponding `EXPOSE`ed port of the service.\n\n### Usage\n\nTo run it:\n\n    $ docker run -d --net host --name docker-discover -e ETCD_HOST=1.2.3.4:4001 -p 127.0.0.1:1936:1936 -t jwilder/docker-discover\n\nThen start any containers that need to access remote containers.  You'll likely want to pass the host's\n IP or the docker bridge IP as an env variable to make it easy for call proxied services.\n\nYou can also access the remote containers directly from the host by sending requests to the\nlocalhost:port.\n\n### Stats Interface\n\nThe haproxy stats interface is exposed on port 1936.  Open your browser to `http://localhost:1936` to view it.\n\n### Limitations\n\nThere are a few simplifications that were made:\n\n* *TCP Proxy* - By default, each listener uses haproxy's `tcp` mode.\n* *Round-Robin Load Balancing* - Multiple containers running on different hosts are load-balanced\nusing a round-robin strategy.  Stateful/sticky requests or master/slave type scenarios are not\ncurrently supported.\n* *Minimal haproxy config* - The haproxy template in place currently is pretty minimal and likely not ready for production use.  Please feel free to submit improvements.\n\n[1]: https://github.com/jwilder/docker-gen\n[2]: http://jasonwilder.com/blog/2014/02/04/service-discovery-in-the-cloud/\n[3]: http://nerds.airbnb.com/smartstack-service-discovery-cloud/\n[4]: https://github.com/airbnb/synapse\n[5]: http://jasonwilder.com/blog/2014/07/15/docker-service-discovery/\n\n### TODO\n\n* Support http, udp proxying\n* Support multiple ports\n* Make ETCD prefix configurable\n* Support other backends (consul, zookeeper, redis, etc.)\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilder%2Fdocker-discover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwilder%2Fdocker-discover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilder%2Fdocker-discover/lists"}