1
votes

I am building a Docker image in my Azure pipeline. Now, I want to push this image to multiple aws accounts(dev, stage, prod) depending on the configuration parameters. The problem is, image is not available in publish artifact. I came across this and this article during my research. I am confused about the solution regarding saving the docker image so it can be available in publish artifact. I have two specific questions:

  1. How will I use the docker save command in Azure pipeline task after docker build. The available docker task doesn't have this command.
  2. Is there any better way of doing this apart from saving an image.
2
Hi, Just checking in to see whether this issue is still blocking you now? Any update for this issue?Vito Liu
I found this article dev.to/n3wt0n/… and my issue got resolved.Raman Balyan
Hi @RamanBalyan, Thanks for the sharing, do you mind converting the comment into answer? So it could help other community members who get the same issues and we could archive this thread. Thanks. Have a nice day. :)Vito Liu

2 Answers

4
votes

How will I use the docker save command in Azure pipeline task after docker build. The available docker task doesn't have this command.

This related to the task version.

Steps: Add task docker->switch the task version to 0->select the option Run a Docker command, then we could run the docker save command, check the pic below.

enter image description here

Is there any better way of doing this apart from saving an image.

We recommend that you use this to upload the docker image as an artifact.

0
votes

After a lot of reserach I found this article which resolved my issue https://dev.to/n3wt0n/container-image-promotion-across-environments-build-artifact-5887

Note: We can manually add commands which are not present in the Docker task snippet available in Azure DevOps. This is also mentioned in the article and steps to do this.