Skip to content

pierredavidbelanger/registrar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

registrar

A Go program that watch Docker events and register / deregister containers as services in Consul.

usage

docker run \
    --net host \
    -v /var/run/docker.sock:/var/run/docker.sock \
    pierredavidbelanger/registrar

This will connect to Consul on localhost:8500 (this is why we need --net host) and Docker on unix:///var/run/docker.sock (this is why we need -v /var/run/docker.sock:/var/run/docker.sock), then listen for Docker events.

When a container become "start", "restart", "unpause", "health_status: healthy" it will be registered as a service in Consul.

When a container become "die", "oom", "pause", "health_status: unhealthy" it will be deregistered from Consul.

About

Register service in Consul from Docker events

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages