Skip to content

Commit f5dcf2f

Browse files
author
David Currie
committed
Add build file and update docs
1 parent 0a2ce9c commit f5dcf2f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
# cpu-usage
2-
Retrieve container CPU usage stats
1+
# Docker CPU Usage Stats
2+
3+
This project builds a simple static golang binary and corresponding Docker image that queries the Docker socket to retrieve the list of running containers and, for each, outputs the total CPU usage and elapsed time since the container was started.
4+
5+
The Docker image can be run as follows:
6+
```bash
7+
docker run -v /var/run/docker.sock:/var/run/docker.sock --rm dcurrie/cpu-usage

build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' .

0 commit comments

Comments
 (0)