Skip to content

Commit

Permalink
docker: add block to show running containers and latest container ip
Browse files Browse the repository at this point in the history
Closes: #168
  • Loading branch information
digitronik authored and kb100 committed Aug 24, 2018
1 parent 7e780ef commit 7b93cab
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker/README.md
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
```
8 changes: 8 additions & 0 deletions docker/docker
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"
Binary file added docker/docker.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docker/i3blocks.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[docker]
command=$SCRIPT_DIR/docker
label=🐳
color=#0db7ed
interval=10

0 comments on commit 7b93cab

Please sign in to comment.