I am trying to build a docker image through Azure DevOps am using sample app (Node Js) to build tag and push to the azure acr, unfortunately its getting failed to find the image
In my yaml config I use AZ CLI task to tag and push the image , However its getting failed while pushing it azure acr. below is my yaml config snippet, am i missing something?
Image is built using docker task
task: Docker@2
displayName: Build an image
inputs:
command: build
repository: azac/myapp
Dockerfile: $(Build.SourcesDirectory)/Dockerfile
tags: latest
output:
REPOSITORY TAG IMAGE ID CREATED SIZE
azac/myapp latest 22ad073063a9 23 seconds ago 133MB
node 18 37b4077cbd8a 12 days ago 997MB
node 18-alpine f520ad35ba68 12 days ago 175MB
moby/buildkit latest 477ce8a5e273 2 weeks ago 168MB
node 14 cedb9f0d0498 2 weeks ago 912MB
node 16 9e98bbbbe8e1 2 weeks ago 910MB
ubuntu 20.04 61c45d0e9798 2 weeks ago 72.8MB
buildpack-deps buster dd092f9559e9 2 weeks ago 803MB
buildpack-deps bullseye 7f6175124be9 2 weeks ago 834MB
ubuntu 22.04 74f2314a03de 2 weeks ago 77.8MB
debian 10 f03c282363a3 2 weeks ago 114MB
debian 11 72b624312240 2 weeks ago 124MB
ubuntu 18.04 b89fba62bc15 2 weeks ago 63.1MB
node 16-alpine fa7e19c4371c 3 weeks ago 117MB
node 14-alpine 4802e63f08a5 4 weeks ago 119MB
alpine 3.14 6dff1269bc79 5 weeks ago 5.61MB
alpine 3.15 5ce65d7b0fde 5 weeks ago 5.59MB
alpine 3.16 dfd21b5a31f5 5 weeks ago 5.54MB
Login Succeeded
Error response from daemon: No such image: myapp:latest
The push refers to repository [azac.azurecr.io/myapp]
An image does not exist locally with the tag: azac.azurecr.io/myapp
I used some of the reference here on stack-overflow Link
task: AzureCLI@2 inputs:
azureSubscription: 'azdo Service Connetion'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
docker images
az acr login --name azac
docker tag myapp azac.azurecr.io/myapp:latest
docker push azac.azurecr.io/myapp:latest