无法在Drone插件drone-gcr和drone-docker中设置上下文

问题描述

错误drone docker plugin question ...

根据documentation ...

context参数不起作用。我在日志中不断遇到file not found错误

如何在drone-docker和drone-gcr插件中设置上下文?

name: publish
image: plugins/gcr
settings:
  context: subdirectory
  registry: registry.dev
  repo: repoName
  tag: latest

我也尝试过

name: publish
image: plugins/gcr
settings:
  file: Dockerfile
  context: subdirectory
  registry: registry.dev
  repo: repoName
  tag: latest

解决方法

您还必须设置dockerfile标志:

name: publish
image: plugins/gcr
settings:
  dockerfile: subdirectory/Dockerfile
  context: subdirectory
  registry: registry.dev
  repo: repoName
  tag: latest