1
votes

Docker image has been created usefully

Successfully built 188e6513fb56 Successfully tagged satyam-hello:20210210.24

My docker push Image task is not working

  • task: Docker@2 displayName: 'Push Container Image' inputs: containerRegistry: '$(SubscriptionEndpoint)' #the ACR service connection created above repository: '$(acrHostName)' imageName: '$(imageName)' command: push tags: '$(tags)'
    ====== below is the error

The push refers to repository [.azurecr.io/.azurecr.io] An image does not exist locally with the tag: .azurecr.io/.azurecr.io ##[error]An image does not exist locally with the tag: .azurecr.io/.azurecr.io ##[error]The process '/usr/bin/docker' failed with exit code 1

2
@ Did you get a chance to check out above update? How did it go?Levi Lu-MSFT

2 Answers

0
votes

The property azureSubscriptionEndpoint doesnot exist for Docker task. See docker task document.

If you use Docker task to push your image to ACR. You need to create a ACR service connection.

Go to Project settings-->Service connection-->New Service connection-->Docker Registry -->Azure Container Registry/Others. See below screenshot.

enter image description here

As above error indicated, you also need to specify the repository property for the Docker task. See below example:

- task: Docker@2
  displayName: push
  inputs:
    containerRegistry: ACR-ServiceConnection  #the ACR service connection created above
    repository: MyRepository #the repository in your ACR
    command: push

Update:

There is no imageName parameter for docker task. If the image is satyam-hello:20210210.24. You should configure docker task as below:

- task: Docker@2
  displayName: push
  inputs:
    containerRegistry: ACR-ServiceConnection #$(SubscriptionEndpoint)
    repository: 'satyam-hello' #$(imageName)
    command: push
    tags: 20210210.24  #$(tags)
0
votes

Thanks for your help! i have created Service connection type-Docker Registry using basic authentication

My question is : Do i need to perform docker login as well before i push the image to ACR

=====

Login to Azure Container Registry

  • task: Docker@2 displayName: Login to ACR inputs: command: login

containerRegistry: '$(dockerRegistryServiceConnection)' #not sure which alpha numberic value i have to specifiy.

  • task: Docker@2 displayName: 'Push Container Image' inputs: containerRegistry: '$(SubscriptionEndpoint)' #the ACR service connection created above repository: '$(acrHostName)' command: push =====