awslabs / aws-container-images-toolkit

A collection of tools to statically and dynamically identify public container images that are hosted on Docker Hub.
https://aws.amazon.com/blogs/containers/advice-for-customers-dealing-with-docker-hub-rate-limits-and-a-coming-soon-announcement/
Apache License 2.0
69 stars 13 forks source link

Fixes issue #7, added changes to read public registry names from exte… #8

Closed deepakcpakhale06 closed 2 years ago

deepakcpakhale06 commented 2 years ago

…rnal config

*Issue #7

Description of changes: Added changes to read public registry names from external config. This allows the base script support public registries other than docker.io

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

deepakcpakhale06 commented 2 years ago

Hello @brentley Could you please review this PR ? If the suggested changes looks ok then I plan to submit PR for codebuild, ecs and kuberntes scripts as well. Thanks

deepakcpakhale06 commented 2 years ago

Can anyone help to review the PR ? @adamjkeller @brentley @mhausenblas

rothgar commented 2 years ago

This change echos the container images 3 times for me

./detect-images.sh test 
./test/Dockerfile.jessie-node buildpack-deps:jessie
./test/Dockerfile.jessie-node buildpack-deps:jessie
./test/Dockerfile.jessie-node buildpack-deps:jessie
./test/Dockerfile.ubuntu-postgresql ubuntu:16.04
./test/Dockerfile.ubuntu-postgresql ubuntu:16.04
./test/Dockerfile.ubuntu-postgresql ubuntu:16.04
./test/Dockerfile.go-app-multi-stage golang:1.7.3
./test/Dockerfile.go-app-multi-stage golang:1.7.3
./test/Dockerfile.go-app-multi-stage golang:1.7.3
./test/Dockerfile.go-app-multi-stage alpine:latest
./test/Dockerfile.go-app-multi-stage alpine:latest
./test/Dockerfile.go-app-multi-stage alpine:latest
./test/Dockerfile.public.ecr.aws public.ecr.aws/amazonlinux/amazonlinux:latest
./test/Dockerfile.go-app golang:1.14
./test/Dockerfile.go-app golang:1.14
./test/Dockerfile.go-app golang:1.14

compared to main which shows

./detect-images.sh test
./test/Dockerfile.jessie-node buildpack-deps:jessie
./test/Dockerfile.ubuntu-postgresql ubuntu:16.04
./test/Dockerfile.go-app-multi-stage golang:1.7.3
./test/Dockerfile.go-app-multi-stage alpine:latest
./test/Dockerfile.go-app golang:1.14
deepakcpakhale06 commented 2 years ago

@rothgar Thank you for testing. Yeah I definitely missed to break out from inner for loop. I have updated PR. Test output is without duplicates.

./test/Dockerfile.go-app golang:1.14 ./test/Dockerfile.ubuntu-postgresql ubuntu:16.04 ./test/Dockerfile.jessie-node buildpack-deps:jessie ./test/Dockerfile.public.ecr.aws public.ecr.aws/amazonlinux/amazonlinux:latest ./test/Dockerfile.go-app-multi-stage golang:1.7.3 ./test/Dockerfile.go-app-multi-stage alpine:latest