-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consul 0.6: dynamic bind address when running in a docker container? #1478
Comments
Hi @drankinn - previously Consul would basically just pick one, so it wasn't a very good mechanism to rely on. This is an interesting problem, though. If you can't bind to 0.0.0.0 then I think you would have to pull the address as things stand now, though this could be made better if Consul would let you bind to an interface name, looking up the address for you. |
In a setup I am building, I also having problems with this. The ip that consul should be delivering on request is different from the ip that is connecting with consul. I have manually fixed it in the containers consul agent by setting the address item in the service defenition file. |
Will look to share code with Nomad on this one - see hashicorp/nomad#186. |
All, please give the latest code in
Very few people should need to do anything as obscene as shown in the last example, but the functionality is there should you need it. With the
There is now a configurable template language for examples and docs) behind this that you can use to create a customizable heuristic that should allow you to get whatever it is that you need from your environment when using an immutable image (see hashicorp/go-sockaddr/template and cmd/sockaddr. |
@sean- awesome, to bad it's not mentioned in https://www.consul.io/docs/guides/bootstrapping.html or https://www.consul.io/docs/agent/options.html |
previously consul would find the docker container's eth0 interface and bind to that by default.
With the change to forcing a bind address with multiple private ips that doesn't work.
I'm a t a loss how to proceed. There isn't a bind address to pass in during the docker run command,
and consul doesn't recognize anything but an ip address as a parameter.
Am I relinquished to writing a wrapper script just to discover the container's IP address before running consul?
The text was updated successfully, but these errors were encountered: