Using secrets from the drone registry plugin

I’ve set up a drone registry plugin following the instructions here: I can verify with the drone cli that there is a username and password set for my ECR repository.

I’ve also configured my drone docker runner (drone/drone-runner-docker:latest) with the DRONE_REGISTRY_PLUGIN_ENDPOINT and DRONE_REGISTRY_PLUGIN_TOKEN env variables.

However I can’t seem to find the correct way to reference these when running my pipeline steps. I’m just getting auth failures when using ‘plugins/docker’.

Can someone point me in the right direction?

the registry plugin is used to pull private images required to run your pipeline steps:

image: <image>

the registry plugin does not expose registry credentials to your pipeline or to your pipeline steps, which means the Docker plugin does not have access to these credentials. This is by design. If you want to globally expose secrets to a plugin you can use organization secrets (

OK I think I understand that. How would one use organization secrets with AWS ECR where the keys expire on a regular basis? The Dockerfile I am trying to build references a private base image as the FROM image and I am getting errors trying to pull it.

you would use plugins/ecr which you provide an aws access key and secret key, which are used to generate fresh login credentials.

I went ahead and used the plugins/ecr as my first step and it builds and pushes the new image as expected.

However in the next step where I’d like to run my tests I’m getting basic auth failures. Maybe I misunderstood but I thought this is where the registry plugin would have provided the correct credentials for pulling the private image.

My drone.yml looks like this:

kind: pipeline
type: docker
name: test

- name: build
  image: plugins/ecr
      from_secret: aws_access_key_id
      from_secret: aws_secret_access_key
    - ${DRONE_COMMIT_SHA:0:7}
- name: test
  - cd /home/app
  - rspec spec

If it’s useful the error I’m getting is:

drone-runner: Error response from daemon: Get no basic auth credentials