Azure devops Azure Devops不支持具有的生成参数Docker@2
我需要从Azure Devops将构建id参数从yaml管道传递到dockerfile。不幸的是,Azure Devops不支持dockerAzure devops Azure Devops不支持具有的生成参数Docker@2,azure-devops,dockerfile,Azure Devops,Dockerfile,我需要从Azure Devops将构建id参数从yaml管道传递到dockerfile。不幸的是,Azure Devops不支持dockerbuild args参数,如下所示 请注意,如果对命令参数使用value buildAndPush,则将忽略arguments属性。 是否有其他方法将参数从Azure Devops传递到dockerfile 是否有其他方法将参数从Azure Devops传递到dockerfile 对。BuildAndPush命令不支持添加参数 但是Build命令支持它 您
build args
参数,如下所示
请注意,如果对命令参数使用value buildAndPush,则将忽略arguments属性。
是否有其他方法将参数从Azure Devops传递到dockerfile
是否有其他方法将参数从Azure Devops传递到dockerfile
对。BuildAndPush命令不支持添加参数
但是Build命令支持它
您可以将buildandpush拆分为Docker build任务和Docker push任务
以下是一个例子:
steps:
- task: Docker@2
displayName: Docker Build
inputs:
command: build
repository: $(imageRepository)
containerRegistry: $(dockerRegistryServiceConnection)
dockerfile: $(dockerfilePath)
tags: 5.12.4
arguments: '--build-arg test_val="$(build.buildid)" '
- task: Docker@2
displayName: Docker Push
inputs:
command: push
repository: $(imageRepository)
containerRegistry: $(dockerRegistryServiceConnection)
tags: 5.12.4
Docker构建步骤结果:
Hi@cfbd,这张票有更新吗?如果答案能给你一些帮助,请随时告诉我。只是提醒一下