I have an azure devops pipeline.
trigger:
- master
resources:
- repo: self
steps:
- task: Docker@2
displayName: Login to ACR
inputs:
command: login
containerRegistry: myDockerHubConnection
- task: Docker@2
displayName: Build an image
inputs:
command: build
arguments: --build-arg git_personal_token=ghp_MYTOKEN
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
tags: tag1
- task: Docker@2
displayName: Push image
inputs:
repository: 'crooksey201/ngx-int-api' #dockerhubAccountName/repoName
command: push
tags: tag1
This builds my image fine, but on the push stage, I get the error:
##[error]An image does not exist locally with the tag: ***/ngx-int-api
And in the list of docker images I just get:
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> f705e0d37a95 Less than a second ago 1.76GB
This image has no tag which I am confused about, as I think I have specified the tags correctly in my pipeline, can anyone spot my error?
2
Answers
The issue was relating to the quotes around
repository
I updated a few things, but a working YAML is:some of the inputs of the task Docker@2 in your example are not documented, and the
imageName:
might berepository:
.