Azure devops 如何在发布候选构建后保留docker映像,以供将来的push-to-prod注册表使用
在通往QA(思考“阶段”)环境的候选发布管道中,我们使用vmImage构建docker容器,然后将其推送到非产品注册中心Azure devops 如何在发布候选构建后保留docker映像,以供将来的push-to-prod注册表使用,azure-devops,azure-pipelines,Azure Devops,Azure Pipelines,在通往QA(思考“阶段”)环境的候选发布管道中,我们使用vmImage构建docker容器,然后将其推送到非产品注册中心 pool: vmImage: "ubuntu-latest" steps: - task: pseudo-code: ## get everything prepped for buildAndPush - task: Docker@2 inputs: containerRegistry: "Our Non-Pr
pool:
vmImage: "ubuntu-latest"
steps:
- task: pseudo-code: ## get everything prepped for buildAndPush
- task: Docker@2
inputs:
containerRegistry: "Our Non-Prod Registroy"
repository: "apps/app-name"
command: "buildAndPush"
Dockerfile: "**/Dockerfile"
tags: |
$(Build.SourceBranchName)
这些是发布候选。一旦代码被批准发布,我们希望将相同的容器推送到我们的生产注册中心;然而,我们不知道如何在这个框架中实现它。看来我们只有两个选择:
- 稍后在另一个管道运行中重建它,这将把它推送到我们的生产注册中心
- 将每个候选发行版容器推送到我们的生产注册中心
pool:
vmImage: "ubuntu-latest"
steps:
- task: pseudo-code: ## get everything prepped for buildAndPush
- task: Docker@2
inputs:
containerRegistry: "Our Non-Prod Registroy"
repository: "apps/app-name"
command: "buildAndPush"
Dockerfile: "**/Dockerfile"
tags: |
$(Build.SourceBranchName)
您还可以查看上面案例中描述的位置。因此,我们使用“Docker@2“插件来管理我们的任务,它不包括‘pull’命令。是否有另一种方法可以在管道中使用docker,您只需在其中发出命令?也许这段代码在yaml中是什么样子的一个例子?