【发布时间】:2022-08-15 03:34:35
【问题描述】:
我有一个 azure devops 管道。
trigger:
- master
resources:
- repo: self
variables:
tag: \'$(Build.BuildId)\'
ImageName: \'ngx-int-api:$(Build.BuildId)\'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: build
arguments: --build-arg git_personal_token=ghp_MYTOKEN
dockerfile: \'$(Build.SourcesDirectory)/Dockerfile\'
imageName: \'$(ImageName)\'
containerregistrytype: \'Container Registry\'
dockerRegistryEndpoint: \'Docker Hub\'
includeLatestTag: true
useDefaultContext: false
tags: |
$(tag)
- task: Docker@2
displayName: Push image
inputs:
containerregistrytype: \'Container Registry\'
dockerRegistryEndpoint: \'Docker Hub\'
imageName: \'$(ImageName)\'
repository: \'crooksey201/ngx-int-api\' #dockerhubAccountName/repoName
command: push
tags: |
$(tag)
这可以很好地构建我的图像,但是在推送阶段,我得到了错误:
##[error]An image does not exist locally with the tag: crooksey201/ngx-int-api
在我刚刚得到的 docker 图像列表中:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> f705e0d37a95 Less than a second ago 1.76GB
这张图片没有我感到困惑的标签,因为我认为我已经在我的管道中正确指定了标签,有人能发现我的错误吗?
标签: docker azure-devops azure-pipelines