Publish all the containers
Publish/remove docker container configs to etcd/consul as they are started and stopped
Useful so other containers on the network can listen in realtime (via etcd/consul) for instructions embedded in a containers environment
Totally stolen from the registrator codebase and modified to publish container details not port mappings.
$ docker pull binocarlos/fleetstreet
You can also just grab the binary from the stage/ folder
Start fleetstreet container passing the following arguments and the etcd or consul endpoint.
- -ip - the IP address of the docker host
- -var - the name of the environment variable that is the container name (FLEETSTREET_NAME)
- -ensure - ensure that the environment variable is set before publishing (false)
$ fleetstreet -ip=x.x.x.x -var=FLEETSTREET_NAME -ensure <registry-uri>
The registry-uri indicates if you are using etcd or consul.
An example running fleetstreet using the etcd endpoint:
$ docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
--name fleetstreet \
binocarlos/fleetstreet --ip 192.168.8.120 etcd://192.168.8.120:4001/fleetstreet
An example running fleetstreet using the consul key/value endpoint:
$ docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
--name fleetstreet \
binocarlos/fleetstreet --ip 192.168.8.120 consul://192.168.8.120:8500/fleetstreet
To run the docker container you must mount the docker socket as a volume.
Each container writes a single record to the key value store containing JSON with the following properties:
- ID - the global id for the container (more below)
- IP - the IP address of the host the container is running (controlled by -ip)
- Container - the data (docker inspect) for the container
The id used to save the container has a default format of:
<hostname>.<containerid>
If you start the container with an environment variable called FLEETSTREET_NAME
- that will be used for the container id:
$ docker run -d \
--name mytest \
-e FLEETSTREET_NAME=mytest \
binocarlos/bring-a-ping --timeout 100
The data for this container would be written to:
/fleetstreet/mytest
To Jeff Lindsay for registrator
MIT