项目作者: expo

项目描述 :
A little script to clean up old Docker images from the Google Container Registry
高级语言: Python
项目地址: git://github.com/expo/prune-gcr.git
创建时间: 2020-04-23T22:24:44Z
项目社区:https://github.com/expo/prune-gcr

开源协议:MIT License

下载


prune-gcr

Tests

A little script to prune old Docker images from the Google Container Registry.

Running the script

The script requires Python 3.9. You can run it with ./prune-gcr --project <project> <repository>. If --project is not specified, it will attempt to infer the default project from your gcloud configuration.

  1. usage: prune-gcr [-h] [--project PROJECT] [--older-than CUTOFF]
  2. [--keep-at-least N]
  3. repository
  4. Prune old Docker images from the Google Container Registry. Example usage:
  5. prune-gcr www
  6. positional arguments:
  7. repository short name of the GCR image repository (as in:
  8. gcr.io/<project>/<repository>)
  9. optional arguments:
  10. -h, --help show this help message and exit
  11. --project PROJECT name of the Google Cloud project. Defaults to
  12. the project in your gcloud configuration.
  13. --older-than CUTOFF prune images older than CUTOFF. Must be formatted as
  14. YYYY-MM-DD. Uses GCP's time zone. Defaults to 90 days
  15. ago.
  16. --keep-at-least N keep at least N images, even if they are older than the
  17. cutoff date. Defaults to 50.