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

how to authenticate this proxy for ECR?

Open moulichowdhary opened this issue 2 years ago • 2 comments

We use aws cli and generate a temporary token. Could you please help me understand how to use this proxy for ECR?

moulichowdhary avatar Nov 13 '22 23:11 moulichowdhary

interesting for me too

robervexcel avatar May 03 '23 13:05 robervexcel

Well, you could maybe try the following:

  • Add aws-cli tool to the Dockerfile
  • Check the REGISTRIES environment variable for AWS ECR-specific URL
  • If there is a AWS ECR URL create a .aws folder with the required config and credentials files used by aws-cli: look at a host config and credential file to see what content is required as well as file permissions
  • Use aws ecr get-login --no-include-email to get the password
  • AUTH_USER=AWS and AUTH_PASS comes from the aws ecr call
  • You will need a script that renews the AWS token periodically (maybe every 6 hours or so)

A lot of this detail was borrowed from https://github.com/Lotto24/aws-ecr-http-proxy

dambrosio avatar Jun 30 '23 22:06 dambrosio