From c8d73caacd27d0f679f62f0d0212e368f4c8efd1 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Tue, 8 May 2018 17:51:40 +0200 Subject: [PATCH] move visualizer to service and stack (#237) --- slides/swarm/firstservice.md | 20 +++++++++----------- stacks/visualizer.yml | 13 +++++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 stacks/visualizer.yml diff --git a/slides/swarm/firstservice.md b/slides/swarm/firstservice.md index 4e172af2..131be148 100644 --- a/slides/swarm/firstservice.md +++ b/slides/swarm/firstservice.md @@ -439,16 +439,10 @@ class: extra-details .exercise[ -- Get the source code of this simple-yet-beautiful visualization app: +- Run this simple-yet-beautiful visualization app: ```bash - cd ~ - git clone git://github.com/dockersamples/docker-swarm-visualizer - ``` - -- Build and run the Swarm visualizer: - ```bash - cd docker-swarm-visualizer - docker-compose up -d + cd ~/container.training/stacks + docker-compose -f visualizer.yml up -d ``` @@ -489,7 +483,7 @@ class: extra-details - Instead of viewing your cluster, this could take care of logging, metrics, autoscaling ... -- We can run it within a service, too! We won't do it, but the command would look like: +- We can run it within a service, too! We won't do it yet, but the command would look like: ```bash docker service create \ @@ -497,12 +491,16 @@ class: extra-details --name viz --constraint node.role==manager ... ``` +.footnote[ + Credits: the visualization code was written by [Francisco Miranda](https://github.com/maroshii). -
+ [Mano Marks](https://twitter.com/manomarks) adapted it to Swarm and maintains it. +] + --- ## Terminate our services diff --git a/stacks/visualizer.yml b/stacks/visualizer.yml new file mode 100644 index 00000000..3c56cd7a --- /dev/null +++ b/stacks/visualizer.yml @@ -0,0 +1,13 @@ +version: "3" + +services: + viz: + image: dockersamples/visualizer + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + ports: + - "8080:8080" + deploy: + placement: + constraints: + - node.role == manager