Open vintikzzz opened 8 years ago
me too
I've solved this issue. The only thing that must to be done is - to rebuild image.
How to check:
version: '2'
services:
consul:
command: -server -bootstrap
image: progrium/consul
ports:
- "8300:8300"
- "8400:8400"
- "8500:8500"
- "8600:53/udp"
registrator:
command: -internal consul://consul:8500
build:
context: .
dockerfile: ./Dockerfile
depends_on:
- consul
volumes:
- /var/run/docker.sock:/tmp/docker.sock
app:
image: buildpack-deps:jessie-curl
command: /bin/sh -c 'while true; do sleep 1; done'
expose:
- 3000
depends_on:
- registrator
docker-compose build
docker-compose run bash
root@57decafee46f:/# curl http://consul:8500/v1/catalog/services
{"alpine":[],"buildpack-deps":[],"capybara-webkit-server":[],"consul":[],"consul-53":["udp"],"consul-8300":[],"consul-8301":["udp"],"consul-8302":["udp"],"consul-8400":[],"consul-8500":[]}root@57decafee46f:/# curl http://consul:8500/v1/catalog/service/buildpack-deps
[{"Node":"c059dfd257a9","Address":"172.20.0.2","ServiceID":"521e4ee1ab77:registrator_app_run_8:3000","ServiceName":"buildpack-deps","ServiceTags":null,"ServiceAddress":"172.20.0.5","ServicePort":3000}]root@57decafee46f:/#
As we can see, ServiceAddress
field become availabe!
Please rebuild image!
After switching to docker-copmose v2 all containers starts to register with consul IP address. All details are available in a gist