docker-swarm-watcher

command module
v0.0.0-...-9af12b3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 15 Imported by: 0

README

docker-swarm-watcher

Listen for docker swarm events and exposes and event endpoint.

Requirements

Only swarm managers can retrieve swarm events. If you're not receiving all events selinux might be the cause.

version: "3"
services:
  web:
    deploy:
      placement:
        constraints: [node.role == manager]

build / install

  • go get -d -v ./...
  • go build ./...
  • go install -v ./...

run

To expose an event endpoint and listen to docker service:create events

docker-swarm-watcher -c="/bin/echo hello" -u username -p password -s="unix:///var/run/docker.sock" -e="service:create"

To specify specific commands for each event you can use a command file. See example-commands.yml

docker-swarm-watcher -u username -p password -s="unix:///var/run/docker.sock" -f="/home/user/commands.yml"

Custom events can be send to http://localhost:8888/v1/event/new

options

Name Flag Description
Command -c Command to execute when an event is fired
username -u Basic authentication username
password -p Basic authentication password
port -port Port to expose -- defaults to 8888
socket -s Docker socket to poll -- e.g. unix:///var/run/docker.sock
events -e Comma separated list of Docker events to listen to
commandFile -f Commands yml file
maxEventAge -max-event-age Replay events if there age is less than x minutes

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