Skip to main content

A in-memory register for Docker services and containers with published ports and labels.

Project description

Summary
=======
This provides a in-memory register of docker services.

Author: Steven hk Wong
Date: Oct 2018

Credits:
monitor.py is based on the work of Miki Tebeka from http://pythonwise.blogspot.com/2015/07/dockermon-docker-process-monitor.html

Description
===========
The life cycle events of create,delete and update of docker services are captured to maintain a in-memory register.
At startup all active services are loaded from docker.
A web UI is provided to see the jason representation of the objects. (see --help)
Callbacks can be registered at startup. A callback json object is passed via stdin.

Callbacks are called with "-c script|program .e.g "python -m docker-register -c jq"

run eg: docker-register -c cb1.sh - cb1.sh is a simple democall back that logs callbacks input into /tmp/cb.log
docker-register -c consul_cb.sh - simple callback that register services to consul on localhost:8500


The callback json object:

{ "type": "service" | "container" , "operation": "register|unregister|update" , "data": { "ports":[ { "PublishedPort": [PORT], "TargetPort":[PORT] .. ], "labels": {}, "id": "THE ID" , "name": "THE NAME]" }

E.g.:
{
"type": "service",
"operation": "register",
"labels": {
"name": "cfssl",
"env": "prod"
},
"ports": [
{
"PublishedPort": 8888,
"TargetPort": 8888
}
],
"name": "cfssl",
"id": "mq6cluihpbe89in6743r3cn1b"
}



Install
=======
To install the python module run: python setup.py install


WIP
===
Adding containers into register.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker-register-0.1.2.tar.gz (26.3 kB view details)

Uploaded Source

File details

Details for the file docker-register-0.1.2.tar.gz.

File metadata

  • Download URL: docker-register-0.1.2.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.7.4 pkginfo/1.3.2 requests/2.19.1 setuptools/0.9.8 requests-toolbelt/0.8.0 clint/0.5.1 CPython/2.7.5 Linux/3.10.0-862.14.4.el7.x86_64

File hashes

Hashes for docker-register-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d120adfffd0697aee7bfd329e1d08bf7d01cabfe5691ebd59f47680606193ea6
MD5 8c11ad3948edb6df7006be0b261c56ca
BLAKE2b-256 6275b31ac0141c25c0a41a3f0b9b0bf1bd46b5f1fa73ebde997c140ab0c8d5b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page