Registrator registers Services with consul. Based on gliderlabs/registrator.
6.6K
Bitbucket: https://bitbucket.org/vicampo/registrator
DockerHub: https://hub.docker.com/r/vicampo/registrator
For the Service Registry to know about services, someone has to tell. The Service Registrator connects to docker and registers and deregisters services from the Registry (Consul).
The way the Registrator registers the services can be configured through environment variables of the service.
SERVICE_IGNORE=true - service registry will ignore that service SERVICE_TAG=tag - Tag the service. (See consul template)
See:
Run the registrator to listen for docker container events (start/stop) to store data for these containers in the registry.
The configure Backend Registry is Consul: http://gliderlabs.github.io/registrator/latest/user/backends/
The environment variables passed to docker run are configuring the how the service will end up in the registry. A service is a golang data structure but in plain json could be translated to:
type Service struct {
ID string // unique service instance ID
Name string // service name
IP string // IP address service is located at
Port int // port service is listening on
Tags []string // extra tags to classify service
Attrs map[string]string // extra attribute metadata
}
Each service can set ID, Name, Tags and Attrs. The other two (IP, Port) are automatically set.
SERVICE_NAME=registrator
SERVICE_TAGS=service,foo,api
SERVICE_ATTR1=custom
SERVICE_ATTR2=data
https://hub.docker.com/r/vicampo/consul/
docker build -t vicampo/registrator:0.1 .
docker push vicampo/registrator
And some docs...
Based on latest Registrator Image from Gliderlabs
Content type
Image
Digest
Size
9.3 MB
Last updated
over 9 years ago
docker pull vicampo/registrator