docker build -t medineshkatwal/gcr-retention:v1.0.3 .
serviceaccount.json
is a json key of IAM service account called gcr-retention-policy
that has these roles
Storage Object Admin
sudo docker run -it -e GCLOUD_SERVICE_KEY="service_account_key" \
-e DELETE_DATE_BEFORE=2018-12-01 \
-e REPOSITORY='repository_xxxx' \
-e INCLUDE='image1|image2|image3' \
medineshkatwal/gcr-retention:v1.0.3