Skip to content

Wizcorp/swarm-announcer

Repository files navigation

Swarm Announcer

It will check at regular interval the docker containers using a specified docker network and register these containers as services and nodes in a consul server.

Development

Local

  • Install the dependencies with make deps
  • Run the announcer with make run --network <network name>

With docker

docker build -t wizcorp/swarm_announcer .
docker run -rm -ti \
    -e DOCKER_HOST=<docker url> \
    -e CONSUL_HOST=<consul host address> \
    -e NETWORK=<network name> \
    wizcorp/swarm_announcer

Updating the image

  • Build the docker container with docker build -t wizcorp/swarm_announcer .
  • Push the image with docker push wizcorp/swarm_announcer

Note: You can use a private registry by prepending the registry address to the image name.

docker build -t registry.in.wizcorp.jp:5000/wizcorp/swarm_announcer .
docker push registry.in.wizcorp.jp:5000/wizcorp/swarm_announcer

Deployment

Deploy with the following command:

docker pull wizcorp/swarm_announcer
docker run -d --restart=always \
    -e DOCKER_HOST=<docker url> \
    -e CONSUL_HOST=<consul host address> \
    -e NETWORK=<network name> \
    wizcorp/swarm_announcer

For example, you can use the following:

docker pull registry.in.wizcorp.jp:5000/wizcorp/swarm_announcer
docker run -d --restart=always \
    -e DOCKER_HOST=tcp://docker.in.wizcorp.jp:2376 \
    -e CONSUL_HOST=consul.service.swarm.wizcorp.jp \
    -e NETWORK=mybridge \
    registry.in.wizcorp.jp:5000/wizcorp/swarm_announcer

Available options:

About

Announce containers using a specific Docker network to a Consul server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published