-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: add block to show running containers and latest container ip
Closes: #168
- Loading branch information
1 parent
7e780ef
commit 7b93cab
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[docker] | ||
command=$SCRIPT_DIR/docker | ||
label=🐳 | ||
color=#0db7ed | ||
interval=10 |