Pulling image from ECR

I am using plugins/ecr to build and push my docker images to ECR but now in next step I need them to run some tests. I tried “dockerconfigjson” approach but it ECR only generate token for 12 hours after which it get expire.
Any steps or guidance for pulling images from ECR.

@frankhills,

Could you please confirm if your test takes more than 12 hours, Also could you please share your sample yaml file that you are using.

Regards,
Harness Support

thank you @csgit for your response,
i have 2 pipelines one for building docker images and push them to ECR (which i have done successfully, thanks to brad), now the second pipeline is where i need to run tests using those images, in short i need to pull them in next pipeline where i will run tests.


pipeline1:

steps:

  • name: build-auth
    image: plugins/ecr
    depends_on: [ clone ]
    settings:
    access_key:
    from_secret: aws_access_key_id
    secret_key:
    from_secret: aws_secret_access_key
    repo: cloudvista
    region: xxx
    registry: xxx.dkr.ecr.xxx.amazonaws.com
    tags: auth${DRONE_COMMIT:0:7}
    dockerfile: path/to/dockerfile
    context: path

pipeline2:

steps:

image_pull_secrets:

  • dockerconfigjson

but as you can see by default Docker ECR token is only valid for 12 hours, how can i get out of this loop.
i read and go through some plugins and a post by brad but nothing seems to be working!