JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q34186F
  • License MIT

Docker discovery and services for swarm

Package Exports

  • darklight

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (darklight) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Discovery tool for data center distributed containers

How does it work

Darklight uses NATS library for sharing docker engine info.

Installing one darklight node per docker host, you either get all the info about all the containers and hosts on the network, or can control any specific docker instance through an RPC like mechanism.

You can embed a darklight node into your application and use it to get that info.

See local.js for full understanding.

Build & run

Build darklight image

docker build --force-rm -t ignitial/darklight .

Run docker unit

tools/scontainer.sh <name>

Run natsio

docker run -d -p 4222:4222 -p 6222:6222 -p 8222:8222 --name nats nats

Utils

Remove current containers (force)

docker rm -f $(docker ps -a -q)
docker rmi $(docker images -f "dangling=true" -q)

Run darklight docker container

docker run -v /var/run/docker.sock:/var/run/docker.sock -e DATASYNC_NATS_SERVERS="[ \"nats://nats:4222\" ]" -e DEBUG="darknode,vikings:*" -e CONTAINER_HOST=192.168.1.105 --link nats:nats --name dl1 ignitial/darklight

Stop container

docker exec dl1 pkill -TERM node