【问题标题】:Drone pushing to Dockerhub fails due to access denied由于访问被拒绝,无人机推送到 Dockerhub 失败
【发布时间】:2019-09-03 19:55:43
【问题描述】:

我已经使用 Docker 插件设置了 Drone。它构建得很好,但无法推送到私有 Dockerhub 存储库。

我已经确认 dockerhub_username 和 dockerhub_password 是环境变量。

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

无人机返回:
denied: requested access to the resource is denied time="2019-09-03T19:34:32Z" level=fatal msg="exit status 1"

我希望看到图像被推送到 Dockerhub。

【问题讨论】:

  • 你试过没有type: exec 部分吗? Docker 插件示例似乎不需要。

标签: dockerhub drone.io


【解决方案1】:

刚刚解决了同样的问题...下面的代码对我有用!

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

【讨论】:

    猜你喜欢
    • 2019-03-29
    • 2017-06-10
    • 2019-05-29
    • 1970-01-01
    • 2019-05-31
    • 2014-06-04
    • 2020-11-24
    • 2017-05-17
    • 1970-01-01
    相关资源
    最近更新 更多