Open babatundebusari opened 7 years ago
Which environment variables are you setting when running the containers?
@isavcic
There are many services running that i gave specific names too but registrator registers them with consul with a totally different name than i gave
one example is consul-agent, the name of the serviceis consul-agent
but registrator had it as consul-53
docker run -d --restart=always \
--name consul-agent --net host \
-v /opt/consul:/consul/data \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/consul/:/consul/config/ \
-h "microservices-agent-$(hostname)" \
-p 53:53/udp -p 53:53 \
consul agent -retry-join=10.247.1.83 -retry-join=10.247.1.85 -retry-join=10.247.1.86 \
-advertise 10.247.1.2 -datacenter us-pa-00
Try _
instead of -
. That works in my case. The number 53
is the public port. If you use multiple ports, a service is registered for each port in Consul. I do not know what the advantage is, I do not like it.
@aboettger-tuhh
Use underscore _
to replace dash -
where exactly?
--name consul_agent
instead of --name consul-agent
@aboettger-tuhh
So that means the name on consul will be consul_agent
right?
I mean its better than what it currently is at least but will be good to be able to name things with -
as well
So that means the name on consul will be consul_agent right?
right :)
I have noticed when i run services with docker, i provide them with names and yet when they register with consul, they have a different name
Why does registrator not respect the names of containers/services?
latest/1.12.1
latest