我正在运行管道,即使cmd脚本清楚地表明目录不是,为什么我仍无法弄清Docker任务中的buildContext为什么为空?
我的azure-pipelines.yml
中的任务如下:
- task: CmdLine@2
inputs:
workingDirectory: './services/UI.Web'
script: 'dir'
- task: Docker@2
inputs:
command: 'buildAndPush'
containerRegistry: 'docker'
repository: 'username/repository'
Tags: tag
Dockerfile: './services/UI.Web/Dockerfile'
buildContext: './services/UI.Web'
管道日志中的输出如下:
Directory of D:\a\1\s\services\UI.Web
... list of files and folders ...
10 File(s) 18 Dir(s) 179,798 bytes
和
"C:\Program Files\Docker\docker.exe" build -f D:\a\1\s\services\UI.Web\Dockerfile -t username/repository:tag D:\a\1\s\services\UI.Web
Sending build context to Docker daemon 3.072kB
如果我将buildContext
更改为'./services'
,则日志输出将更改为
"C:\Program Files\Docker\docker.exe" build -f d:\a\1\s\services\UI.Web\Dockerfile -t username/repository:tag d:\a\1\s\services
Sending build context to Docker daemon 2.701GB