Closed bioshed closed 1 year ago
def list_containers(): containers = {} client = boto3.client('ecr-public', region_name='us-east-1') next_token = 'first' while next_token != '': metadata = client.describe_repositories( registryId=REPO_REGISTRY_ID, maxResults=1000 ) if next_token == 'first' else \ client.describe_repositories( registryId=REPO_REGISTRY_ID, maxResults=1000, nextToken=next_token ) repos = metadata['repositories'] for repo in repos: containers[repo['repositoryName']] = repo['repositoryUri'] next_token = metadata['nextToken'] if 'nextToken' in metadata else '' return containers
boto3 ?