Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supporting AWS public registry: public.ecr.aws #36

Closed
vincentsarago opened this issue Dec 10, 2020 · 2 comments · Fixed by #37
Closed

supporting AWS public registry: public.ecr.aws #36

vincentsarago opened this issue Dec 10, 2020 · 2 comments · Fixed by #37

Comments

@vincentsarago
Copy link

vincentsarago commented Dec 10, 2020

This is not a bug repport but maybe more a documentation request so please feel free to close it if there is a better place to raise this. And because I'm far to be an expert, I maybe totally wrong!

The public AWS repository (public.ecr.aws) needs almost the same login process as the private ECR but there is a huge difference in the registry URL which make it not compatible with this action

aws ecr-public get-login-password --region {region} | docker login --username AWS --password-stdin public.ecr.aws/{user_registry_name}

there are 2 problems with the public registry url:

  1. there is no amazonaws in the registery name, so:

export const isECR = async (registry: string): Promise<boolean> => {
return registry.includes('amazonaws');
};

isn't triggered

  1. there is no region in the registry url, so:

login-action/src/aws.ts

Lines 9 to 11 in 12fd633

export const getRegion = async (registry: string): Promise<string> => {
return registry.substring(registry.indexOf('ecr.') + 4, registry.indexOf('.amazonaws'));
};

won't work as well.

I see a blocker for a region, but this could be resolved if the user uses the Configure AWS Credentials action

Edit:
well there is a third point

  1. the aws cli sub command is ecr-public not ecr 🤦
@vincentsarago vincentsarago changed the title supporting was public registry: public.ecr.aws supporting AWS public registry: public.ecr.aws Dec 10, 2020
vincentsarago referenced this issue in developmentseed/titiler Dec 10, 2020
@crazy-max
Copy link
Member

@vincentsarago Thanks for your feedback I will take a look at adding support to this registry.

@vincentsarago
Copy link
Author

Also FYI, you'll need aws-sdk>=2.806.0https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#28060 which is not the one provided by aws-actions/configure-aws-credentials@v1 yet (maybe in couple days I guess)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants