2

I'm using the Drone.IO CI/CD software to build and publish an image to an ECR in another AWS account, in the same region EU-WEST-1.

I have setup the IAM artefacts and it is connecting but failing on the last step. It seems that Drone is ignoring my registry option im passing it and just using the registry from the AWS API call.

Drone is running in account 0987654321 and Im trying to push the image to account 1234567890.

  ecr:
    image: plugins/ecr
    registry: 12345677890.dkr.ecr.eu-west-1.amazonaws.com
    repo: repo1/app_name
    region: eu-west-1
    tags: latest
    dockerfile: Dockerfile

I get the following error:

+ /usr/local/bin/docker tag blah 0987654321.dkr.ecr.eu-west-1.amazonaws.com/repo1/app_name:latest
+ /usr/local/bin/docker push 0987654321.dkr.ecr.eu-west-1.amazonaws.com/repo1/app_name:latest
The push refers to repository [0987654321.dkr.ecr.eu-west-1.amazonaws.com/repo1/app_name]
name unknown: The repository with name repo1/app_name does not exist in the registry with id '0987654321'

Which makes it appear as though its not even using the registry attribute and using the registry from the API call.

Garreth
  • 1,057
  • 2
  • 9
  • 24

2 Answers2

0

I know it might be a little late, but used Drone in my old job for this specific case of pushing images to an ECR repository in another AWS account. In the old bash ECR plugin (now is Go) it used to be with --registry-ids option if not wrong. Seems now it is documented.

Sergio Guillen Mantilla
  • 1,460
  • 1
  • 13
  • 20
0

This looks like a known bug in the ECR plugin. The registry setting is getting ignored in favour of the default registry returned from AWS - which will be the one in the account Drone is running in.

Once this PR is merged it should work.

David Neale
  • 16,498
  • 6
  • 59
  • 85