This project helps you to remove containers/networks/volumes/images by given filter after specified delay.
The psanetra-master branch contains a fork, which patches some issues in the original testcontainers/moby-ryuk distribution.
- Prune images if the container was signaled whith SIGINT or SIGTERM (See ryuk#22)
- Fixes possible concurrency issues (See ryuk#24)
- Dependencies were updated (Alpine, Go, Go dependencies)
- Versions have the format
YEAR.MONTH.DAY
(e.g.2022.01.01
)
docker pull ghcr.io/psanetra/ryuk:2021.12.20
-
Start it:
$ ./bin/moby-ryuk -p 8080 $ # You can also run it with Docker $ docker run -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 pull ghcr.io/psanetra/ryuk:2021.12.20
-
Connect via TCP:
$ nc localhost 8080
-
Send some filters:
label=testing=true&health=unhealthy ACK label=something ACK
-
Close the connection
-
Send more filters with "one-off" style:
printf "label=something_else" | nc localhost 8080
-
See containers/networks/volumes deleted after 10s:
2018/01/15 18:38:52 Timed out waiting for connection 2018/01/15 18:38:52 Deleting {"label":{"something":true}} 2018/01/15 18:38:52 Deleting {"label":{"something_else":true}} 2018/01/15 18:38:52 Deleting {"health":{"unhealthy":true},"label":{"testing=true":true}} 2018/01/15 18:38:52 Removed 1 container(s), 0 network(s), 0 volume(s), 0 image(s)