Keval
Keval

Reputation: 1612

Drone CI can't authenticate with private repository

The following .drone.yml:

kind: pipeline

steps:
- name: publish
  image: registry.example.com/hub/plugins/docker
  settings:
    registry: registry.example.com
    repo: registry.example.com/some/repo
    tags: latest
    username:
      from_secret: registry-user
    password:
      from_secret: registry-pass

image_pull_secrets:
  - docker-token

fails with the following error:

publish: Error response from daemon: unauthorized: unauthorized to access repository: hub/plugins/docker, action: pull: unauthorized to access repository: hub/plugins/docker, action: pull

where registry.thechubbypanda.net/hub is a proxy for hub.docker.com.

The secret docker-token was created with cli command: drone secret add --name docker-token --data ~/.docker/config.json --repository some/repo.

The ~/.docker/config.json file's contents is:

{
    "auths": {
        "https://registry.example.com": {
            "auth": "MYLEGITTOKEN"
        }
    }
}

I believe that I've followed the steps on the drone docs and this question correctly.

Upvotes: 1

Views: 1901

Answers (0)

Related Questions