jenkinsci / amazon-ecr-plugin

Amazon EC2 Container Registry plugin for Jenkins
https://plugins.jenkins.io/amazon-ecr/
MIT License
32 stars 22 forks source link

login failing for Amazon ECR public repository #170

Open ravikishore1979 opened 10 months ago

ravikishore1979 commented 10 months ago

docker.withRegistry fails to login for a public repository but works with the private repository. Can we use this plugin to login to the Amazon ECR public repository?

Tesseract99 commented 8 months ago

I am facing this issue too. Pushing to Public ECR registry with this plugin doesn't work. Works fine for private ones. I could not find any clarification regarding this in the readme either.

TobiX commented 1 month ago

Public and private ECR repositories use completely different API endpoints and IAM objects (ecr:GetAuthorizationToken vs. ecr-public:GetAuthorizationToken), so this is no surprise. One could probably extend this plugin to support both (with a new "mapping prefix"), but it won't work out-of-the-box.

I'm not interested in implementing this myself, but I might merge an extension to this plugin (preferably with tests & without too much code duplication)