Git Product home page Git Product logo

docker-swarm-visualizer's Introduction

Sample image of  nodes with data

Docker Swarm Visualizer

*** note *** This only works with Docker Swarm Mode in Docker Engine 1.12.0 and later. It does not work with the separate Docker Swarm project

Thanks to all the contributors, and a special thanks to @DovAmir and @alexellis for their big contributions.

Demo container that displays Docker services running on a Docker Swarm in a diagram.

This works only with Docker Swarm Mode which was introduced in Docker 1.12. These instructions presume you are running on the master node and you already have a Swarm running.

Each node in the swarm will show all tasks running on it. When a service goes down it'll be removed. When a node goes down it won't, instead the circle at the top will turn red to indicate it went down. Tasks will be removed. Occasionally the Remote API will return incomplete data, for instance the node can be missing a name. The next time info for that node is pulled, the name will update.

To run:

$ docker run -it -d -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer

If port 8080 is already in use on your host, you can specify e.g. -p [YOURPORT]:8080 instead. Example:

$ docker run -it -d -p 5000:8080 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer

To run in a docker swarm:

$ docker service create \
  --name=viz \
  --publish=8080:8080/tcp \
  --constraint=node.role==manager \
  --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
  manomarks/visualizer

Running on ARM

@alexellisuk has pushed an image to the Docker Hub as alexellis2/visualizer-arm:latest it will run the code on an ARMv6 or ARMv7 device such as the Raspberry Pi.

If you would like to build the image from source run the following command:

$ docker build -f Dockerfile.arm -t visualizer-arm:latest .

Running on Windows

@StefanScherer has pushed an image to the Docker Hub as stefanscherer/visualizer-windows:latest it will run the code in a Windows nanoserver container.

If you would like to build the image from source run the following command:

$ docker build -f Dockerfile.windows -t visualizer-windows:latest .

On Windows you cannot use -v to bind mount the named pipe into the container. Your Docker engine has to listen to a TCP port, eg. 2375 and you have to set the DOCKER_HOST environment variable running the container.

$ip=(Get-NetIPAddress -AddressFamily IPv4 `
   | Where-Object -FilterScript { $_.InterfaceAlias -Eq "vEthernet (HNS Internal NIC)" } `
   ).IPAddress

docker run -d -p 8080:8080 -e DOCKER_HOST=${ip}:2375 --name=visualizer stefanscherer/visualizer-windows

Connect to a TLS secured Docker engine

To work with a TLS secured Docker engine on Windows, set the environment variable DOCKER_TLS_VERIFY and bind mount the TLS certificates into the container.

$ip=(Get-NetIPAddress -AddressFamily IPv4 `
   | Where-Object -FilterScript { $_.InterfaceAlias -Eq "vEthernet (HNS Internal NIC)" } `
   ).IPAddress

docker run -d -p 8080:8080 -e DOCKER_HOST=${ip}:2376 -e DOCKER_TLS_VERIFY=1 -v "$env:USERPROFILE\.docker:C:\Users\ContainerAdministrator\.docker" --name=visualizer stefanscherer/visualizer-windows

TODO:

  • Take out or fix how dist works
  • Comment much more extensively
  • Create tests and make them work better
  • Make CSS more elastic. Currently optimized for 3 nodes on a big screen

docker-swarm-visualizer's People

Contributors

adomenech73 avatar alexellis avatar beenanner avatar clarenceb avatar docwhat avatar dovamir avatar icarobichir avatar johnharris85 avatar manomarks avatar marcosnils avatar mrq1911 avatar simedia-ivansieder avatar sirlatrom avatar stefanscherer avatar woyorus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.