1

I have set up Drone with the Docker plugin. It is building just fine, but fails to push to a private Dockerhub repo.

I have confirmed that dockerhub_username and dockerhub_password are environment variables.

kind: pipeline
type: exec
name: default

steps:
- name: docker
  image: plugins/docker
  settings:
    repo: jbc22/myrepo
    username:
      from_secret: dockerhub_username
    password:
      from_secret: dockerhub_password
  publish:
    image: jbc22/myrepo
    report: jbc22/myrepo

Drone returns with:
denied: requested access to the resource is denied time="2019-09-03T19:34:32Z" level=fatal msg="exit status 1"

I would expect to see the image pushed to Dockerhub.

  • Have you tried it without the `type: exec` part? The Docker plugin examples don't seem to need that. – char Sep 16 '19 at 11:33

1 Answers1

0

Just fixed the same issue... Code down below works for me!

name: default

kind: pipeline

steps:
- name: backend
  image: python:3.7
  commands:
    - pip3 install -r req.txt
    - python manage.py test

- name: publish
  image:  plugins/docker
  settings:
    username: dockerhub_username
    password: dockerhub_password
    repo: user/repo_name