问题
I am using self hosted agent to run my build pipeline. The agent machine has got the base docker image downloaded. The pipeline builds and pushes a new docker image (based on top of the base image) using the 1st task as shown in the following screenshot.
Once the image is built and pushed to the container registry, I wish to clean up the images (created as part of this pipeline) from the self hosted agent to avoid disk space issues in the future (the base image should remain). Is there a Docker task to cleanup/remove the built image? In the azure build pipeline, how to cleanup the docker image from self hosted agent once it is pushed?
来源:https://stackoverflow.com/questions/61606043/in-the-azure-build-pipeline-how-to-cleanup-the-docker-images-created-as-part-o