4

I'm trying to change the tag of a Docker image using a Docker task on an Azure DevOps pipeline, without success.

Consider the following Docker image hosted on an Azure container registry:

Docker image

My task is configured as follows:

Docker task

$(DockerImageName) value is agents/standard-linux-docker2:310851

I'm trying to change the Docker image tag (e.g. to latest) but so far I wasn't able to make it work. I've also tried to set the arguments as well, without success.

Task fails with the following error message:

Error response from daemon: No such image: agents/standard-linux-docker2:310851

/usr/bin/docker failed with return code: 1

What am I missing here?

8
  • hm, can you try pulling that image first? mb it doesnt auth before tagging, so fails to find that image Commented Feb 21, 2019 at 10:34
  • Hi @4c74356b41, could you please elaborate? I'm fairly new to Docker, I'm still trying to understand how things work. Image agents/standard-linux-docker2:310851 was already pushed to Azure, now I just want to change the tag. The idea is to have different tags per environment, e.g. latest would correspond to the Production image. Commented Feb 21, 2019 at 10:45
  • add a step with docker pull, before the docker tag step, so it downloads the image locally Commented Feb 21, 2019 at 10:52
  • I'll give it a try, thanks @4c74356b41 Commented Feb 21, 2019 at 11:00
  • @4c74356b41 what about the syntax of my push task above? How should I set the arguments? Commented Feb 21, 2019 at 11:02

1 Answer 1

2

Try using Azure CLI Task. Run the following command and select the options in the image.

az acr import --name xxxxxacr --source xxxxxacr.azurecr.io/xxx/xxx-api:stage --image xxxxyyyyyyy/yyyyyyyy-api:prod --force

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.