3

我设置了一个简单的 go 项目,我希望构建一个简单的 docker 映像并将其部署到我的私有注册表中。这是我的 .drone.yml:

pipeline:   
  build:
    image: golang
    commands:
      - go build

  docker:
    image: plugins/docker
    username: xxxxxxxxxxx
    password: yyyyyyyyyyy
    repo: docker.mycompany.it:5000/drone/test
    tags: latest
    debug: true

但是插件会尝试连接到 docker 注册表并对其进行身份验证。

4

1 回答 1

6

如果您使用自定义注册表,则需要registry在插件配置 [1] 中设置参数。注册表参数提供给 docker login 命令(例如docker login gcr.io

使用自定义注册表的示例配置:

pipeline:
  docker:
    image: plugins/docker
    repo: index.company.com/foo/bar
    registry: index.company.com

[1] 来源http://plugins.drone.io/drone-plugins/drone-docker/

于 2017-04-27T23:15:12.050 回答