fleetstreet

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2014 License: MIT Imports: 11 Imported by: 0

README

fleetstreet

Publish all the containers

streetsign

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.

install

$ docker pull binocarlos/fleetstreet

You can also just grab the binary from the stage/ folder

usage

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.

container data

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

container ids

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

Thanks

To Jeff Lindsay for registrator

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL