How to publish docker image as an artifact in azure devops

  azure, azure-devops, azure-pipelines, docker

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.

Source: Docker Questions