Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
/ gcd Public archive

🐳 Garbage Collector for Docker -- Arquivado por Foundation Platform dia 2023-11-28

License

Notifications You must be signed in to change notification settings

stone-payments/gcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcd

Build Status Coverage Status Go Report Card

Description

This project is a garbage collector for docker images and containers. It was created to alleviate the problem of old and unused containers laying around on Docker utilizing storage resources.

Usage

Running locally built ELF

./bin/gcd

Running pre-built Docker image from Docker Hub

docker run --name gcd -v /var/run/docker.sock:/var/run/docker.sock guiferpa/gcd

Parameters

gcd can be parametrized via command-line arguments and, if you're using the Docker image, by environment variables.

CLI arguments

  • -docker-host: set docker host target (default: /var/run/docker.sock).
  • -sweep-interval: set interval in seconds between sweeps (default: 60).
  • -remove-images: remove images that aren't container dependencies (default: true).
  • -remove-healthy-containers-exited: remove containers exited with code 0 (default: true).

Environment variables

  • GCD_DOCKER_HOST: set docker host target (default: /var/run/docker.sock).
  • GCD_SWEEP_INTERVAL: set interval in seconds between sweeps (default: 60).
  • GCD_REMOVE_IMAGES: remove images that aren't container dependencies (default: true).
  • GCD_REMOVE_HEALTHY_CONTAINERS_EXITED: remove containers exited with code 0 (default: true).

Building

Building ELF

git clone https://github.com/stone-payments/gcd.git
make build

Building docker image

⚠️ This project uses multi-stage build to build the docker image with the included Dockerfile. Docker >=17.05 is required.

make build-image

License

This code is licensed under the MIT license.

About

🐳 Garbage Collector for Docker -- Arquivado por Foundation Platform dia 2023-11-28

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •