1

i have been trying out drone and have been unsuccessful in pushing the docker image to gcr.

pipeline:
  build:
    image: plugins/docker
    dockerfile: docker/Dockerfile
    registry: gcr.io
    repo: gcr.io/<REPO>
    tags: "${DRONE_COMMIT_SHA}"
    insecure: true
    debug: true

The following is the error message:

denied: Unable to access the repository; please check that you have permission to access it.

I have been trying to follow the documentation but I always get this error. Need help. Thanks.

hyper20
  • 21
  • 2

1 Answers1

1

The first step is to store your credentials (we call them secrets) in drone. You can do this using the command line utility or the user interface.

drone secret add <github_repo> --name=docker_username --value=<username>
drone secret add <github_repo> --name=docker_password --value=<password>

Once you have stored your credentials you must update your yaml configuration file to request access to the named secrets using the secrets attribute (this seems to be missing in your example). Example configuration:

pipeline:
  build:
    image: plugins/docker
    dockerfile: docker/Dockerfile
    registry: gcr.io
    repo: gcr.io/<REPO>
    secrets: [ docker_username, docker_password ]

For reference please see the following secret documentation which uses the docker plugin as the primary example http://docs.drone.io/manage-secrets/

Brad Rydzewski
  • 2,523
  • 14
  • 18