https://github.com/thbkrkr/dockmd2redis
Cache Docker run executions in Redis
https://github.com/thbkrkr/dockmd2redis
Last synced: 3 months ago
JSON representation
Cache Docker run executions in Redis
- Host: GitHub
- URL: https://github.com/thbkrkr/dockmd2redis
- Owner: thbkrkr
- Created: 2016-07-14T00:57:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-14T01:03:57.000Z (about 10 years ago)
- Last Synced: 2025-03-02T17:48:20.921Z (over 1 year ago)
- Language: Go
- Size: 547 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dockmd2redis
Execute commands or script in Docker and save results in Redis.
```
run(*image, "nodes", "docker-machine", "ls")
run(*image, "containers", "list_all_containers")
```
```
> ./dockmd2redis -image krkr/c2
INFO[0000] OK key=nodes:krkr/c2
INFO[0001] OK key=containers:krkr/c2
```
```
> d exec -ti banana_redis_1 redis-cli get nodes:krkr/c2
"NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS\nn1 * ovh Running tcp://149.202.176.196:2376 v1.12.0-rc3 \n"
> d exec -ti banana_redis_1 redis-cli get containers:krkr/c2 | sed -e 's|\\n||g' -e 's|\\||g' -e 's|^"||' -e 's|"$||' | jq '.[].Names'
[
"/iris.1.6e67srh31ifb3vrmnheat8ezz"
]
[
"/apish.1.3rjklddxirxqahw90pfreto64"
]
[
"/o_metrics"
]
```