简体   繁体   中英

How to publish docker image as an artifact in azure devops

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.

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.

在此处输入图像描述

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM