Tutti Nuovi

user:thomas utente che ha creato il gist

title:mygist titolo del gist

filename:myfile.txt nome di file nel gist

extension:yml estensione del file nel gist

language:go linguaggio del file nel gist

topic:homelab gists with given topic

Entra


Tutti Nuovi Entra

All gists matching topic ecr

Più recente creazione
Meno recente creazione
Più recente aggiornamento
Meno recente aggiornamento

botanikanet / ECR Cleanup

0 mi piace
0 forks
1 files
Ultima volta attivo 10 months ago
Script for cleanup ecr
aws ecr example
1 aws ecr get-login-password | docker login --username AWS --password-stdin $(aws ecr describe-registry --query registryId --output text).dkr.ecr.eu-west-1.amazonaws.com
2 for REPOSITORY in $(aws ecr describe-repositories | jq -r '.repositories[].repositoryName'); do echo "${REPOSITORY}"; aws ecr describe-images --repository-name ${REPOSITORY} | jq --arg pull_t $(date +%Y-%m-%dT00:00:00 -d '1 months ago') --arg push_t $(date +%Y-%m-%dT00:00:00 -d '3 months ago') '.imageDetails|sort_by(.imagePushedAt) [:-20] | .[] | select(.lastRecordedPullTime? | . <= $pull_t ) | select(.imagePushedAt | . <= $push_t ) | "imageDigest=\(.imageDigest)"' | tr '\n' ' ' | xargs -n 99 -r aws ecr batch-delete-image --no-cli-pager --repository-name ${REPOSITORY} --image-ids; done
Più nuovi Più vecchi

Creato da Opengist ⋅ Load: 30ms⋅

Italiano
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文