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

Pull amazonlinux:2 from public.ecr.aws #799

Closed
charlie-harvey opened this issue Aug 8, 2023 · 5 comments
Closed

Pull amazonlinux:2 from public.ecr.aws #799

charlie-harvey opened this issue Aug 8, 2023 · 5 comments
Assignees

Comments

@charlie-harvey
Copy link

Feature description

If I am building in AWS, for lambda, the default image is "amazonlinux:2". Great!
But if I try to build my image lots of times I will get denied pull access to Docker Hub. So I can instead pull the image from AWS's hub, public.ecr.aws. Sure, I can set this in my build.gradle.kts. But it would be just as easy to have it hardcoded to that value in the first place.

docker-plugin/src/main/java/io/micronaut/gradle/docker/NativeImageDockerfile:

        private String resolve() {
            String baseImage = getBaseImage().getOrNull();

            if (strategy == DockerBuildStrategy.LAMBDA && baseImage == null) {
                baseImage = "public.ecr.aws/amazonlinux/amazonlinux:2";
            } else if (baseImage == null) {
                baseImage = "frolvlad/alpine-glibc:alpine-" + DefaultVersions.ALPINE;
            }

            return baseImage;
        }

I will try to get to making a PR for this. Thanks.

@timyates
Copy link
Contributor

There are also rate limits for unauthenticated ECR requests from outside of AWS infrastructure.

I found a blog post here which says:

Note that while pulls from ECR Public do work from outside AWS, they are rate limited if not authenticated with an Amazon account, and you should generally use the Docker Hub addresses if you are pulling from outside AWS. Please see the ECR Public quotas documentation for more about how limits work with ECR Public.

However the blog post is old, and likely to be skewed towards gaining docker signups ;-)

Also the Amazon ECR limit seems to be one pull per second (I guess per IP) for unauthenticated users

And the docker one is 100 pulls in 6 hours (again for unauthenticated users)

My gut feeling is to leave it pointing at dockerhub, and maybe adding explicit documentation around switching to public.ecr.aws if rate limits are hit...

@charlie-harvey
Copy link
Author

charlie-harvey commented Aug 24, 2023 via email

@timyates
Copy link
Contributor

Thanks for raising this Charlie 👍

@sdelamo
Copy link
Contributor

sdelamo commented Aug 24, 2023

@timyates is it document it how to change it?

@timyates
Copy link
Contributor

@sdelamo Doing that now

timyates added a commit that referenced this issue Aug 24, 2023
As discussed in #799 we will document how to change this.
melix pushed a commit that referenced this issue Aug 29, 2023
As discussed in #799 we will document how to change this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants