From 7b93cabe24f2fde028df9815bd7a70a2a270dbd0 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Sun, 12 Aug 2018 15:41:49 +0530 Subject: [PATCH] docker: add block to show running containers and latest container ip Closes: https://github.com/vivien/i3blocks-contrib/pull/168 --- docker/README.md | 19 +++++++++++++++++++ docker/docker | 8 ++++++++ docker/docker.jpg | Bin 0 -> 4197 bytes docker/i3blocks.conf | 5 +++++ 4 files changed, 32 insertions(+) create mode 100644 docker/README.md create mode 100755 docker/docker create mode 100644 docker/docker.jpg create mode 100644 docker/i3blocks.conf diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..58119960 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,19 @@ +# docker + +Show the number of running `Docker` containers and latest created container IP address. + +![](docker.jpg) + +# Dependencies + +*docker* + +# Config + +``` +[docker] +command=$SCRIPT_DIR/docker +label=🐳 +color=#0db7ed +interval=10 +``` diff --git a/docker/docker b/docker/docker new file mode 100755 index 00000000..d38271fa --- /dev/null +++ b/docker/docker @@ -0,0 +1,8 @@ +#!/bin/bash + +# Number of docker containers running +count=$(docker ps -q | wc -l | sed -r 's/^0$//g') +# Recent docker container IP +recent_ip=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $(docker ps -ql)) + +echo "$count: $recent_ip" diff --git a/docker/docker.jpg b/docker/docker.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bff8237c8209d4f7375301b3567e54833ebee9fd GIT binary patch literal 4197 zcmeHEc{J3~+y9O+j5T8`YZ7S)Wy?rqX9i=88Ox|NSu!N+RFq_oOf+VYkT96BRCWp} zOIcEbkV0gQitI~X`knKh-@otw@8_O#&%O6~KA-3FJa=bcXA}@ZnIX*p5C{ZV>@Hwu z9`M9?`Ud$1diwgwX{sFubd8YKoSeWOtfV=he`gOG+@(n+dnyasmy5F9Xs=J4WyK7LO`lWxAKxqyD-~c#xh5%y#%&~{P z9lQ%pF3vqbxws%)JWyU<9w-kFFaJJ%UOquS9v%UhfZ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bgZRW^~4^;m_4=AZlqpn1Abik3k-l?NSRKeVu%GmqL>_yIo?{>fJEALH7 zk?n}zODXJVt)9|nZ<7C1A=@YQ>~j_H_U~I>bQ2ejI_LYpD$Cn1`2pwibx_56=~u0i zh@z4c9UgRe1btXqrMM-Oak-PATIxd1^%m82HO`7PoM{zxpI{wv^U9lD3jA^Kym1{C zP{GDi8XT0a7?3BYf*tRJ|2vzT2er6z5PC`-@jVnrZfa(% zPwrKgR#fR2xFt9Da_YgdZ9lhg>Qvfl@kWv#?WsEPcVyY0Eb~6|bJG7W{hxuvtVuc) zj-}-@JsHhjy&&!ulO5paY3~(RVz=Xdd;9klc1epGi^&+0gSZ*omYYM6`wG?uF4(}x L8zn8lb_V|k+zpL! literal 0 HcmV?d00001 diff --git a/docker/i3blocks.conf b/docker/i3blocks.conf new file mode 100644 index 00000000..e3c26c45 --- /dev/null +++ b/docker/i3blocks.conf @@ -0,0 +1,5 @@ +[docker] +command=$SCRIPT_DIR/docker +label=🐳 +color=#0db7ed +interval=10