awslabs / amazon-ecr-credential-helper

Automatically gets credentials for Amazon ECR on docker push/docker pull
Apache License 2.0
2.49k stars 337 forks source link

Downloading latest binary directly? #227

Open onyxraven opened 4 years ago

onyxraven commented 4 years ago

On github you can now link to the latest release asset directly https://docs.github.com/en/github/administering-a-repository/linking-to-releases - but it seems like potentially this system doesn't like the slashes in your release paths.

Expected to work:

wget https://github.com/awslabs/amazon-ecr-credential-helper/releases/latest/download/linux-amd64/docker-credential-ecr-login

Actual:

wget https://github.com/awslabs/amazon-ecr-credential-helper/releases/latest/download/linux-amd64/docker-credential-ecr-login
--2020-07-10 16:20:40--  https://github.com/awslabs/amazon-ecr-credential-helper/releases/latest/download/linux-amd64/docker-credential-ecr-login
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github.com/awslabs/amazon-ecr-credential-helper/releases/download/v0.4.0/linux-amd64/docker-credential-ecr-login [following]
--2020-07-10 16:20:40--  https://github.com/awslabs/amazon-ecr-credential-helper/releases/download/v0.4.0/linux-amd64/docker-credential-ecr-login
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 404 Not Found
2020-07-10 16:20:41 ERROR 404: Not Found.

Is there another good way to get the latest (without going down the old road of parsing the page)? an S3 link perhaps?

I assume this is actually a github bug (which I'll report) but perhaps this repo could somehow get around it?

skyzyx commented 4 years ago

Use the GitHub API? That's how it's done with Homebrew.

onyxraven commented 4 years ago

Use the GitHub API? That's how it's done with Homebrew.

Yeah the bummer is that is rate limited, so I fear it'd get throttled. I've run into this before. Maybe there's an another approach though.

skyzyx commented 4 years ago

If you authenticate, though, the rate limit is much higher.