Search code examples
imageamazon-web-servicesdockerregistrytoken

How to update ECR login token without regenerate every 12 hours?


Followed this guide to try to set the ECR token helper, but didn't work well.

https://aws.amazon.com/blogs/compute/authenticating-amazon-ecr-repositories-for-docker-cli-with-credential-helper/

After 12 hours, the token went away and didn't generate a new one.

Is it possible to generate it in a easy way?


Solution

  • As I know, You have to re-generate ECR token after every 16 hours (or 8 hours I do not remember the figure)

    For this, you can use any method like CRON job, Jenkins jobs or whatever. But there is no setting to set age for the token in ECR.

    I not seen the link you provided but looks this is some kind of Jenkins job. If the job ran successfully, Set a periodically build triggers for the job. In configuring jobs page of Jenkins there is an option "Build periodically" you need to specify CRON like settings.

    If your job itself is felling check your keys/roles attached to the machine. Still, your luck not helped Post Jenkins console log here.