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

Also this is a sample app meant for learning Docker. Running this app in production is insecure and should be avoided. If you want to run it in production you must take all security precautions, and in particular Protect the Docker daemon socket with SSL.

This project was originally created by Francisco Miranda for the 2015 DockerCon EU keynote. It was adapted to be used for the 2016 DockerCon US keynote showcasing Docker swarm mode. Since then the community has generously contributed many updates. 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 dockersamples/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 dockersamples/visualizer

To run with a different context root (useful when running behind an external load balancer):

$ docker run -it -d -e CTX_ROOT=/visualizer -v /var/run/docker.sock:/var/run/docker.sock dockersamples/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 \
  dockersamples/visualizer

Supported architectures

The main dockersamples/visualizer image supports linux/amd64.

For armhf, there is a pre-built image available. See Running on ARM.

For Windows, there is a separate Dockerfile.windows and image. See Running on Windows.

Missing your architecture? See Building a custom image.

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.

$ 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 \
  alexellis2/visualizer-arm:latest
  • Update/rebuild the image:

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

$ docker build -t visualizer-arm:latest .

Make sure you do this on a Raspberry Pi directly.

View on Docker Hub

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

Building a custom image

When building for Windows, see Running on Windows.

To build an up-to-date image for any architecture supported by node:8-alpine (currently amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le and s390x), execute the following command on a device of your target architecture:

$ docker build -t visualizer-custom:latest .

Afterwards you can start visualizer by using any of the commands stated above. Just replace dockersamples/visualizer with visualizer-custom. For example:

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

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

adirio avatar adomenech73 avatar alexellis avatar aloyr avatar beenanner avatar booms8 avatar bretfisher avatar chrisns avatar clarenceb avatar dependabot[bot] avatar docwhat avatar dovamir avatar estesp avatar icarobichir avatar johnharris85 avatar layzeedk avatar manomarks avatar marcosnils avatar minimonium avatar mrq1911 avatar randombyte avatar ryslandev avatar simedia-ivansieder avatar sirlatrom avatar stefanscherer avatar tophj-ibm avatar vanuan avatar woyorus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-swarm-visualizer's Issues

server.js stop at first request

I have try to send requests on the app but it fails with this error :

`[cloud@bastion]$ docker pull manomarks/visualizer
Using default tag: latest
slave2: Pulling manomarks/visualizer:latest... : downloaded 
slave1: Pulling manomarks/visualizer:latest... : downloaded 
master1: Pulling manomarks/visualizer:latest... : downloaded 
[cloud@bastion]$ docker-compose up
Starting dockerswarmvisualizer_visu_1
Attaching to dockerswarmvisualizer_visu_1
visu_1  | npm info it worked if it ends with ok
visu_1  | npm info using [email protected]
visu_1  | npm info using [email protected]
visu_1  | npm info prestart [email protected]
visu_1  | npm info start [email protected]
visu_1  | 
visu_1  | > [email protected] start /app
visu_1  | > node server.js
visu_1  | 
visu_1  | undefined
visu_1  | undefined:1
visu_1  | 404 page not found
visu_1  |     ^
visu_1  | 
visu_1  | SyntaxError: Unexpected token p
visu_1  |     at Object.parse (native)
visu_1  |     at IncomingMessage.<anonymous> (/app/server.js:68:36)
visu_1  |     at emitNone (events.js:72:20)
visu_1  |     at IncomingMessage.emit (events.js:166:7)
visu_1  |     at endReadableNT (_stream_readable.js:893:12)
visu_1  |     at doNTCallback2 (node.js:430:9)
visu_1  |     at process._tickCallback (node.js:344:17)
visu_1  | 
visu_1  | npm info [email protected] Failed to exec start script
visu_1  | npm ERR! Linux 4.4.0-28-generic
visu_1  | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
visu_1  | npm ERR! node v4.1.2
visu_1  | npm ERR! npm  v2.14.4
visu_1  | npm ERR! code ELIFECYCLE
visu_1  | npm ERR! [email protected] start: `node server.js`
visu_1  | npm ERR! Exit status 1
visu_1  | npm ERR! 
visu_1  | npm ERR! Failed at the [email protected] start script 'node server.js'.
visu_1  | npm ERR! This is most likely a problem with the swarmVisualizer package,
visu_1  | npm ERR! not with npm itself.
visu_1  | npm ERR! Tell the author that this fails on your system:
visu_1  | npm ERR!     node server.js
visu_1  | npm ERR! You can get their info via:
visu_1  | npm ERR!     npm owner ls swarmVisualizer
visu_1  | npm ERR! There is likely additional logging output above.
visu_1  | 
visu_1  | npm ERR! Please include the following file with any support request:
visu_1  | npm ERR!     /app/npm-debug.log

also can we call it in HTTPS ?

Thanks

Understand service constraints

I've using a global service with label constraints to run my database containers only on specific nodes. So I created the service like this:

docker service create --name rethinkdb-master --mode global --constraint node.labels.rethink-role==master rethinkdb

visualizer screenshot

The rethink-master processes on the second two nodes will never start because of their constraints.

Can we somehow detect that they're not eligible to run and have them hidden completely instead of giving the appearance that they've crashed on startup?

Simple password authentication

It would be nice that if visualizer supports simple password authentication to prevent unauthorized users when I expose it to the internet...

Task missing at service update

When I update image of a service, the tasks may go down and come up. But in most cases some tasks disappear in this period. I'll have to refresh visualizer to get them back.

In this example, 4 tasks from service test are running but only 2 are shown.

ubuntu@ip-172-19-241-144:~$ docker service ls
ID            NAME  REPLICAS  IMAGE                      COMMAND
ikbylntzf1a8  test  5/5       dongluochen/simpleweb:2.0
itaigkgu9o4h  viz   1/1       manomarks/visualizer

ubuntu@ip-172-19-241-144:~$ docker service ps test | grep -i running
test.1.aepqd3xweezqtgbcqtwrq26f4      dongluochen/simpleweb:2.0  ip-172-19-241-144  Running        Running 35 seconds ago
test.2.maqa2woorz8g7erg0nuok31wl      dongluochen/simpleweb:2.0  ip-172-19-241-145  Running        Running 12 seconds ago
test.3.t3e0npr9f9mimrqaa5dfrby86      dongluochen/simpleweb:1.0  ip-172-19-241-146  Running        Running 4 minutes ago
 \_ test.4.shrsqrcnosli2cjo0ek21frop  dongluochen/simpleweb:1.0  ip-172-19-241-146  Shutdown       Running 3 minutes ago
test.5.z4uclx3cc9c8x98d2fvfacf3y      dongluochen/simpleweb:1.0  ip-172-19-241-145  Running        Running 4 minutes ago

screen shot 2016-11-03 at 10 34 03 am

This project is awesome!

CSS Issues

screen shot 2017-06-02 at 4 41 15 pm

Seeing a css issue on hover of the node elements. Looks like the position: absolute on the div is causing the problem.

Make it possible use socket-proxy

In my setup, I like to use "rancher/socat" which exposes the Docker socket to the my swarm via TCP.
I then connect apps (e.g. Traefik.io) that need the socket to that TCP endpoint. This means I only have to mount the managers Docker socket as volume once.

Please provide an option to connect the visualizer to a TCP exposed [possibly non-secured] socket.

no such image : manomarks/visu… on 1.13

hi,

i upgraded my docker swarm engine to 1.13.0 yesterday and the visualizer is no longer working for me.
if i rollback to 1.12.6 with the same viz service create cmd & it works.

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

j588605rxyfk viz.1 manomarks/visualizer:latest totod Ready Rejected 3 seconds ago "No such image: manomarks/visu…"
himt2p9lf4g6 _ viz.1 manomarks/visualizer:latest totod Shutdown Rejected 9 seconds ago "No such image: manomarks/visu…"
zdsybsaop9nr _ viz.1 manomarks/visualizer:latest totod Shutdown Rejected 13 seconds ago "No such image: manomarks/visu…"
uxticfavukmo _ viz.1 manomarks/visualizer:latest totod Shutdown Rejected 19 seconds ago "No such image: manomarks/visu…"
raqf1k63srq2 _ viz.1 manomarks/visualizer:latest totod Shutdown Rejected 24 seconds ago "No such image: manomarks/visu…"

docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Tue Jan 17 09:55:28 2017
OS/Arch: linux/amd64

Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Tue Jan 17 09:55:28 2017
OS/Arch: linux/amd64
Experimental: false

docker service ls
ID NAME MODE REPLICAS IMAGE
8h38a7w1bqkw ansible replicated 13/13 ansible2.2
p2nphhjreujd viz replicated 0/1 manomarks/visualizer:latest

uname -r
3.10.0-514.2.2.el7.x86_64

-Alex

[FEATURE REQUEST] Display 'drained' nodes

We have our mangers configured to 'drained' so they don't run containers automatically. It would be good if we could grey them out or somehow show that they are drained.
docker node update --availability drain <NODE>

The setting is readable in the docker node inspect command json, so would be good to expose that.

Thanks,
PS. Loving this project so far

Security

How secure is this for running in production?

It looks like it exposes the Docker Remote API to the world. Is it correct?

Errors on service creation

When I created a Docker swarm service with the following (I had created the image visualizer-arm locally):

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
visualizer-arm

I got these errors:
unable to pin image visualizer-arm to digest: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

And when I tried to scale it up I found that all the services were running on the swarm controller and not on the worker nodes.

Another service I have is running on the worker nodes without an issue.

ENJOYING_THIS_PROJECT="SayThankYou"

Here is the place to say thank you to folks who are working hard on this project.

« One of the greatest ways to show your appreciation to open source projects you enjoy is to open an issue that let people say thank you »

Disclaimer: I don't have any kind of connexion or personal interest with maintainers(s) of this project. Pure gratitude here.

Cheers!

Tag: undefined

"Tag : undefined" is displayed for tags of "latest", named tags such as "v6" do show up.

dibs on this.

No such container Message

When you click on a container inside a different note than the visualizer container as seen in the next image

image

You get the following json response

image

I spec to get the same kind of response that when the container is in the same node as the visualizer container.

image

Subdirectory support?

Thanks for creating this cool project!

Is it possible to configure this container to serve its content out of a subdirectory?

I would like serve this app, along with other admin/monitoring tools, out of admin.mydomain.com behind a reverse proxy like nginx. But after configuring it to proxy_pass to this application's container, the application's javascript will still try to hit /apis/ on the root directory, causing it to fail to load the dashboard.

It would be great if I could pass an argument to this container to say serve out of /subdirectory/ as it would make proxy configuration easy and painless.

memory display less than 1GB (for Pi clusters etc)

viz
Hi, this is an excellent app for simply illustrating docker clusters in a "lab" environment. In these environments Raspberry Pi clusters are common. However most Pis (Zeros) have less than 1GB memory, but the recent mod to display memory in GB displays "0" for memory sizes less than 1GB. Please can the memory display line be tweaked slightly to show fractions of GB (0.5GB) for 512MB nodes?

thanks again for an excellent tool

Doug

Service created but not assigned

Hi,

Thanks for your application, I want to use it but I have a problem.
I have 3 master and 3 worker nodes. Master node Availabilities Drain (because I don't want to use them)

10.0.0.2:~$ docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
0xd9pv31tstr04e2et2a8hyue swarm-manager1 Ready Drain Reachable
54nly90kgy765kcbijytrtvie swarm-node3 Ready Active
65is5lrerk5vg0eobhq6tyra7 swarm-node2 Ready Active
786oitrqobh69hfohr4bipxi8 swarm-manager3 Ready Drain Reachable
7x9e95ii8wrx9vtttqcvyzzvo * swarm-manager2 Ready Drain Leader
btgkcecu5tdoxd81jn3b0kv5d swarm-node1 Ready Active

That is command for run
DOCKER_HOST=10.0.0.2:2375 docker service create --name=viz --publish=5000:8080/tcp --constraint=node.role==manager --mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --env HOST=10.0.0.2 manomarks/visualizer

But service waiting for assign.

10.0.0.2:~$ docker service ls
ID NAME REPLICAS IMAGE COMMAND
35ix70f64x7i viz 0/1 manomarks/visualizer

Is there anything missed?

UI calling localhost:8080 - Raspberry PI

I have a Raspberry pi cluster that I wanna manage. However, I changed the main port number to 5000 and I'm opening the UI from my laptop instead of the raspberry PI running my swarm manager.

screen shot 2016-11-02 at 6 51 55 am

After starting the container in a node and opened it in my browser, I can see that the UI app is trying to look for "localhost:8080".

screen shot 2016-11-02 at 6 52 51 am

Questions

It should be calling pimanager:5000 instead of localhost:8080.

  • Is there an ENV var that I need to pass to make the UI call its container name instead of localhost?

Image and tag names not displayed correctly when registry host[:port] present

I have service containers deployed in swarm-mode from images tagged with the registry host and port, e.g.: registry.local:5000/vote:v1. I want to display then using docker-swarm-visualizer for a demo but they appear incorrectly.

Expected image name: (Option 1) vote or (Option 2) registry.local:5000/vote
(Not too fussed which option)
Expected image tag: v1

Actual image name: registry.local
Actual image tag: 5000/vote

I was playing around to see how this could be done and found this regex works for Option 1:

let imageNameRegex = /([^/]+?)(\:([^/]+))?$/

The image name and tag can be retrieved like so:

let imageName = imageNameMatches[1]
let tagName = imageNameMatches[3]

This works for these possible combinations:

  • registry.local:5000/vote:v1
  • registry.local/vote:v1
  • registry.local/vote
  • vote:v1
  • vote

You might be able to think of a nicer regex.

I can submit a pull request if you think its a good idea.

Update node.png

The node.png currently linked from README.md is the image before the label is modified from #26 to [free to RAM].

Since the change has already been reflected, node.png also needs to be replaced.

cmd gets truncated

I have long-ish commands, and would like to see a bit more displayed - could be mouse-over for full command, or wrap-around to next line?

node hostname not scaleable

Hey Mano... love the new improvements. I have some long hostnames like es.demo.splunkninja.com. on four nodes, they tend to clog each other up. cmd +- doesn't have an effect.
screenshot 2016-09-07 11 09 45

Feature: Highlight drain nodes

When nodes are in "drain" state, you could change the node status indicator to another color (grey, orange, yellow ....) ....

Also: Thank you ;)

Possible to put some authentication ?

We are using this extensively in our projects . Our URLs are public & we wanted to put some kind of authentication in front . I know authentication is not really required but still just to keep things to ourselves .

Is it possible to put a basic http auth in front ? If not , is there any plans ?

404 page not found

$ docker run -it -d -p 8080:8080 -e HOST=ucp-controller-540dd7c4.east1a.prod -e constraint:node==ucp-controller-540dd7c4.east1a.prod -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer

10:50 $ docker logs -f 960f0ab11bd8
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]

[email protected] start /app
node server.js

undefined:1
404 page not found
^

SyntaxError: Unexpected token p
at Object.parse (native)
at IncomingMessage. (/app/server.js:49:36)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:893:12)
at doNTCallback2 (node.js:430:9)
at process._tickCallback (node.js:344:17)

npm info [email protected] Failed to exec start script
npm ERR! Linux 3.10.0-327.18.2.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! This is most likely a problem with the swarmVisualizer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls swarmVisualizer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log

Stuck in state "Pending"

Hello,

I have just created a docker swarm from scratch, and I am not able to run the visualizer, since its stuck in pending.

$ docker service ls && docker service ps viz
ID                  NAME                MODE                REPLICAS            IMAGE                             PORTS
ylpdkfqjv0o8        viz                 replicated          0/1                 dockersamples/visualizer:latest   *:9090->8080/tcp
ID                  NAME                IMAGE                             NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
j7z2l72rlf46        viz.1               dockersamples/visualizer:latest                       Running             Pending 4 minutes ago                       

Docker version:

$ docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:10:54 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:10:54 2017
 OS/Arch:      linux/amd64
 Experimental: false

apt-cache policy docker-engine
docker-engine:
  Installed: 17.05.0~ce-0~ubuntu-xenial
  Candidate: 17.05.0~ce-0~ubuntu-xenial

Same setup on 17.03 works, so I suspect the 17.05 is not supported yet?

Unable to display content while containers are preparing

data-provider.js fails during container preparation (downloading, preparing).

This causes a complete halt of the visualization in the event you have a restart:always container failing on preparing (e.g. 'Invalid mount type..', etc)

data-provider.js:85 Uncaught (in promise) TypeError: Cannot read property 'ContainerID' of undefined
    at data-provider.js:85
    at a (index.js:326)
    at Function.<anonymous> (index.js:3241)
    at s (data-provider.js:67)
    at Array.forEach (<anonymous>)
    at w (data-provider.js:221)
    at data-provider.js:280

Not sure why, as it should've had a container ID to get that far.

Visualizer not displaying node

The visualizer does display the visualizer screen with the whale without any nodes in browser (Firefox & Chrome) when entering URL: http://192.168.1.201:5000/

$ uname -a
Linux one 3.16.0-76-generic #98~14.04.1-Ubuntu SMP Fri Jun 24 17:04:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ docker version
Client:
Version: 1.12.0-rc2
API version: 1.24
Go version: go1.6.2
Git commit: 906eacd
Built: Fri Jun 17 21:09:07 2016
OS/Arch: linux/amd64

Server:
Version: 1.12.0-rc2
API version: 1.24
Go version: go1.6.2
Git commit: 906eacd
Built: Fri Jun 17 21:09:07 2016
OS/Arch: linux/amd64

Commands entered on host one:
$ docker swarm init
Swarm initialized: current node (0r69ag4og37sjuxqpvrnecbo2) is now a manager.
$ docker run -it -d -p 5000:5000 -e HOST=hostname -i -e PORT=5000 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer
c2caeb401a591c18e113ca85cde87461df36705bb6984a36f1f356636aab5255
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
12d847d0bf21 manomarks/visualizer "npm start" 27 minutes ago Up 27 minutes 0.0.0.0:5000->5000/tcp, 8080/tcp grave_lamport

$ docker node ls
ID NAME MEMBERSHIP STATUS AVAILABILITY MANAGER STATUS
0r69ag4og37sjuxqpvrnecbo2 * one Accepted Ready Active Leader
d0b03wee9kff872tpjbe5kpzs four Accepted Ready Active

$ docker logs $(docker ps -lq)
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]

[email protected] start /app
node server.js

problem with request: connect ECONNREFUSED /var/run/docker.sock
Error: connect ECONNREFUSED /var/run/docker.sock
at Object.exports._errnoException (util.js:849:11)
at exports._exceptionWithHostPort (util.js:872:20)
at PipeConnectWrap.afterConnect as oncomplete
problem with request: connect ECONNREFUSED /var/run/docker.sock
Error: connect ECONNREFUSED /var/run/docker.sock
at Object.exports._errnoException (util.js:849:11)
at exports._exceptionWithHostPort (util.js:872:20)
at PipeConnectWrap.afterConnect as oncomplete
problem with request: connect ECONNREFUSED /var/run/docker.sock
Error: connect ECONNREFUSED /var/run/docker.sock
at Object.exports._errnoException (util.js:849:11)
at exports._exceptionWithHostPort (util.js:872:20)
at PipeConnectWrap.afterConnect as oncomplete
... continues repeating this error ...

Checked fire wall:
$ sudo ufw status verbose
Status: active
Logging: on (medium)
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip
To Action From


22 LIMIT IN 192.168.1.0/24
53 ALLOW IN 192.168.1.0/24
80 ALLOW IN 192.168.1.0/24
111 ALLOW IN 192.168.1.0/24
443 ALLOW IN 192.168.1.0/24
2049 ALLOW IN 192.168.1.0/24
2375 ALLOW IN 192.168.1.0/24
2376 ALLOW IN 192.168.1.0/24
3375 ALLOW IN 192.168.1.0/24
3376 ALLOW IN 192.168.1.0/24
4789 ALLOW IN 192.168.1.0/24
7946 ALLOW IN 192.168.1.0/24
8300 ALLOW IN 192.168.1.0/24
8301 ALLOW IN 192.168.1.0/24
8400 ALLOW IN 192.168.1.0/24
8500 ALLOW IN 192.168.1.0/24
8600 ALLOW IN 192.168.1.0/24
2377 ALLOW IN 192.168.1.0/24
3000 ALLOW IN 192.168.1.0/24
5000 ALLOW IN 192.168.1.0/24

Thank you for your help

No support for DOCKER_TLS_VERIFY

I have a Docker Swarm mode cluster set up with TLS, but no unencrypted or unix socket access since it's Windows. I'm using @StefanScherer 's steps with a few changes:

  • DOCKER_HOST is set to port 2376 instead of 2375 or :0.0
  • DOCKER_TLS_VERIFY is set to 1
  • Certificates are bind mounted into user's .docker directory

I would expect this to work since it follows the typical environment variables and certificates used for docker.exe and docker-compose.exe, but no luck.

Specific commands:

$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

It fails to attach to the TLS port:

docker : npm info it worked if it ends with ok
    + CategoryInfo          : NotSpecified: (npm info it worked if it ends with ok:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError


npm info using [email protected]
npm info using [email protected]
npm info ok
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]
> [email protected] start C:\app
> node server.js

172.20.192.1:2376
problem with request: Parse Error
Error: Parse Error
    at Error (native)
    at Socket.socketOnData (_http_client.js:322:20)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:536:20)
problem with request: Parse Error

The last error stack repeats several times.

Memory usage display incorrect

Running on a 1.12 cluster, seeing incorrect output:

screen shot 2016-09-01 at 2 13 01 pm

These machines are almost maxed out, should be showing ~1-2GB free

Starts, but nothing displayed

Hi,

I have started visualizer with this...

docker run --name=visualizer -it -d -p 9000:9000 -e HOST=10.2.10.34 -e PORT=9000 -v /var/run/docker.sock:/var/run/docker.sock manomarks/visualizer

and it shows up correctly as running, but has an undefined error (investigations show this is due to process.env.DOCKER_HOST being empty)

10.2.10.34 is the IP of our swarm master, although as below the master runs visualizer on swarm-node-02 at 10.2.10.44

90aa79e4b705        manomarks/visualizer           "npm start"              3 minutes ago       Up 3 minutes        8080/tcp, 10.2.10.44:9000->9000/tcp   swarm-node-02/visualizer

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]

> [email protected] start /app
> node server.js

undefined

This is on Docker 1.12, Swarm 1.2.5, deployed via boot2docker 1.12.0.

The end result is a screen identical to that in #19

Error: Request has been terminated

I deploy the container apparently fine, the log that I see is:

logs visualizer-aarch64_box

> [email protected] start /app
> node server.js

undefined

I launch it on a swarm master node. but when I open the startup page http://hostip:8080 I only can see the background with a docker logo as header, but nothing else.

Firefox debug console is showing this error repeatly:

Error: Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.app.js:9:8091

Any clue about what it can be wrong?

Should we removes the dev dependencies from the docker image?

I think we should removes the dev dependencies from the docker image. It could saves around 100MB on the image sizes (from 370MB to 230MB).

We could change this parts:

# Install dependencies
RUN npm install --unsafe-perm=true

# Add the rest of the sources
ADD . /app

# Build the app
RUN npm run dist

To something like this:

# Only add those files we need at runtime
ADD ./cfg/* /app/cfg/
ADD ./dist/* /app/dist/
ADD ./node_modules/* /app/node_modules/
ADD ./src/* /app/src/
ADD ./create-index.js /app
ADD ./index.tpl /app
ADD ./server.js /app

And use something like TravisCI to run the npm run dist before building the docker image.

Visualizer not showing up nodes

I have 1 master node and 3 worker node. I have started the container as shown below:

root@test-master1:# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
5e71e28bb451 manomarks/visualizer "npm start" 4 minutes ago Up 4 minutes
0.0.0.0:5000->5000/tcp, 8080/tcp dreamy_colden
522701d5e817 ajeetraina/nagios-docker:latest "/usr/bin/supervisord" 49 minutes ago Up 49 minutes
25/tcp, 80/tcp collabnix.4.5o64dlt55dh4o0w9ssczlg9ks
f193c0a406cd ajeetraina/nagios-docker:latest "/usr/bin/supervisord" 49 minutes ago Up 49 minutes
25/tcp, 80/tcp collabnix.3.augcoqggdb65aynl40k897k9f
root@test-master1:
#

But the http://104.196.21.223:5000/ turns up just a visualizer without any node being shown.
The logs too looks okay as shown below

root@test-master1:~# docker logs --details dreamy_colden
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]

[email protected] start /app
node server.js

Anything I am missing out??

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.