docker-registry-ui icon indicating copy to clipboard operation
docker-registry-ui copied to clipboard

Usage with AWS ECR private registry repo

Open pawofacat opened this issue 2 years ago • 5 comments

I'm not sure if this project is usable with AWS ECR private registry repo.

Tried using ui-as-proxy as example where I set the NGINX_PROXY_PASS_URL as my AWS ECR repo url and entered the auth but got an error message "Could not resolve registry id from host localhost".

Would appreciate any advice!

pawofacat avatar May 31 '22 00:05 pawofacat

Hello there. Sorry I'm not familiar with AWS ECR, what is the protocol they are using for auth ? basic auth ? token auth ?

Joxit avatar May 31 '22 21:05 Joxit

Hi, I've tried the basic auth with username and password. Here's the aws guide for auth to their docker registry for you reference.

pawofacat avatar Jun 01 '22 03:06 pawofacat

Hum... It seems like you will need to generate a token with this comand

TOKEN=$(aws ecr get-authorization-token --output text --query 'authorizationData[].authorizationToken')

This token is a base64 encoded string that contains a login and password, so you can reverse it with this command:

echo $TOKEN | base64 -d

This will produce an output with semicolon, the first part will be the login and the second part the password.

Try it and tell me if this worked :smile:

Joxit avatar Jun 19 '22 15:06 Joxit

Unfortunately, it doesn't seem to work. It still calls the same error "Could not resolve registry id from host localhost".

pawofacat avatar Jun 20 '22 03:06 pawofacat

This is weird because in the part "Using HTTP API authentication" they use the command

TOKEN=$(aws ecr get-authorization-token --output text --query 'authorizationData[].authorizationToken')

Then this one

curl -i -H "Authorization: Basic $TOKEN" https://aws_account_id.dkr.ecr.region.amazonaws.com/v2/amazonlinux/tags/list

That means the token must follow the Basic Authorization specification and it's a base64 encoded string of something like username:password.

Your registry URL must be https://aws_account_id.dkr.ecr.region.amazonaws.com

Can you try the example from the user guide and tell me if it works ?

I'm sorry, I do not have a AWS account and can't try it myself...

Joxit avatar Jul 06 '22 21:07 Joxit

Hi there, I'm closing this issue due to inactivity

Joxit avatar May 20 '23 17:05 Joxit