An automated, lightweight, and professional Go utility designed to keep your Docker environment lean and efficient. It safely removes unused resources without interrupting your active containers.
The most portable way to run the tool. Ideal for servers and CI/CD environments.
One-shot run:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock rafaelqsantos/docker-cleanup
Running as a Daemon (Background Service):
docker run -d \
--name docker-cleanup \
-e CLEANUP_INTERVAL=24h \
-v /var/run/docker.sock:/var/run/docker.sock \
rafaelqsantos/docker-cleanup
Download the latest binaries for your platform from the Releasesโ page.
# Example for Linux
./docker-cleanup-linux-amd64
If you prefer running from source:
git clone https://github.com/rafael-qsantos/Management-go.git
cd Management-go
go run main.go
Control the behavior of the tool using environment variables:
| Variable | Description | Default | Example |
|---|---|---|---|
CLEANUP_INTERVAL | Time to wait between cleanup cycles (Daemon Mode) | Empty (Runs once) | 1h, 24h, 30m |
DOCKER_HOST | Docker socket path (inherited from environment) | unix:///var/run/docker.sock | - |
This project is fully automated via GitHub Actions:
v*) triggers a multi-platform binary build.latest and version tags.Distributed under the MIT License. See LICENSE for more information.
Built with โค๏ธ by Rafael Queiroz Santos
Content type
Image
Digest
sha256:e417db51cโฆ
Size
9.4 MB
Last updated
10 months ago
docker pull rafaelqsantosrqs/docker-cleanup