jwilder / docker-register Goto Github PK
View Code? Open in Web Editor NEWService registration for docker containers
Service registration for docker containers
Hey Jason,
I think these two projects (docker-register and docker-discover) are filling a really useful niche for my company, and I'd like to add support for multiple TCP ports. I just wanted to walk through the fix to make sure it was a change you agreed with.
Since docker-discover already exposes a service with etcd keys like this:
/backends/<container name>/port = <port exposed by HAProxy>
/backends/<container name>/<container id> = <docker host:exposed docker port>
I was thinking we could just suffix with the port used by the process-in-the-container. E.g. if you have a docker ps
like
CONTAINER ID IMAGE .... PORTS NAMES
xxxyyyzzz some-web-process 0.0.0.0:49153->8000/tcp, 0.0.0.0:49154->9000/tcp myservice
You could expose it in etcd with these keys:
/backends/myservice-8000/port = "80"
/backends/myservice-8000/xxxyyyzzz = "my.ip.he.re:49153"
/backends/myservice-9000/port = "5000"
/backends/myservice-9000/xxxyyyzzz = "my.ip.he.re:49154"
effectively treating a service with two ports like two separate services from the HAProxy perspective. This wouldn't require changing docker-discover at all.
I have some images from third parties that have EXPOSE lines in their Dockerfile, and I haven't yet seen anything online to 'un-expose' them. Since they have more than 1 port exposed (but, say, only a single port mapped), docker-register doesn't work with them.
I have only 'Hello World' level experience with Go, but looking through the source of docker-register and docker-gen, I wondered if changing "Addresses" in the template to "PublishedAddresses" (https://github.com/jwilder/docker-register/blob/master/etcd.tmpl#L30) would fix this, and if it would do so without breaking existing uses of docker-register?
I am trying to run a docker-register container on a host running docker containers. While I see teh containers being registered in the logs it fails with the following error message
etcd.EtcdKeyNotFound: Key not found : /backends
I tried running the container with the --privilege option and also tried creating the /backends directory myself but no luck. I am on a ubuntu vm based off vagrant. Docker version 1.7
I have stop my backend container, but it's always on etcd.
Why?
Hi there,
I'm getting
==> Error starting agent: Failed to get advertise address: Multiple private IPs found. Please configure one.
When I run via docker-compose or straight via the command line. I'm using Docker 1.8 on docker-machine, host machine OSX.
Any ideas?
Probably pretty naive question, but I've read up today on service discovery stuff and am impressed with the ease of the Smartstack approach. (I like it above consul for instance).
I wanted to start setting-up Smartstack (which still sadly uses Zookeeper, although Etcd integration is near finished hopefully) on a CoreOS environment, when I discovered your blog introducing docker-register + docker+discover.
Just to get my head around this: things like Redis which don't expose a health-endpoint can't currently be checked with docker-register. Is that true? As a workaround, I was thinking of having a very small sidekick node app which only exposes a /health
endpoint and only returns OK when Redis is up (and is the current master). Would that work?
I have modified it to support etcd v3. In case any need it, you can find it at https://github.com/weimingwill/docker-register
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.