DEV Community

Cover image for How to use Amazon ECR Public over IPv6

How to use Amazon ECR Public over IPv6

So you want to pull your Docker images from Amazon ECR Public over IPv6?

You are probably looking to remove your public IPv4 addresses in order to save on your AWS bill. But the fact that ECR Public doesn't seem to support IPv6 may be holding you back. Fortunately, the fix is easy.

Simply use ecr-public.aws.com instead of public.ecr.aws. Example:

# Use this when pulling over IPv4 or IPv6:
ecr-public.aws.com/ubuntu/ubuntu:latest

# The old URIs only work with IPv4:
public.ecr.aws/ubuntu/ubuntu:latest
Enter fullscreen mode Exit fullscreen mode

I can't think of any reason when you should continue to use public.ecr.aws. Please correct me in the comments if I am wrong.

This new domain is official, although it is, so far, poorly documented. You can find references to it in the user guide pdf.

Why did they introduce a new domain name instead of simply adding AAAA records to the old one? I don't know, but it is such an Amazon thing to do. They do this all the time. My guess is that they want to avoid breaking customers that have badly configured networks. While that's very considerate of them, in this case I think having two ways to refer to the same docker image in ECR Public is confusing and annoying. Isn't this why we have the Happy Eyeballs algorithm?

The web gallery still only gives you image URIs using public.ecr.aws. Let's hope they improve that in the future.

Hope this helps!

Top comments (0)