Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Accessing consul instance on host machine from docker container #200

Closed
vicmosin opened this issue Dec 22, 2016 · 2 comments
Closed

Accessing consul instance on host machine from docker container #200

vicmosin opened this issue Dec 22, 2016 · 2 comments

Comments

@vicmosin
Copy link

vicmosin commented Dec 22, 2016

Tried different options (providing local, 127.0.0.1 and real IP addresses) to container, but still doesn't work.. App inside container can't find hosts.

docker run -e consul.host=http://consul.service.consul:8500 -p 6080:8080 container

return Consul.builder()
            .withUrl(host)
            .build();

Caused by: java.net.UnknownHostException: consul.service.consul: unknown error
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_72-internal]
@rickfast
Copy link
Owner

Can you try a dig on the DNS name from inside the container? I don't think this is a problem with the client

@rickfast
Copy link
Owner

rickfast commented Feb 1, 2017

assuming problem is fixed since you didn't reply. closing for now

@rickfast rickfast closed this as completed Feb 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants