title: In the azure build pipeline, how to cleanup the docker images (created as part of the pipeline) from self hosted agent once it is pushed?
body: <p>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.</p>
  
  <p><a href="https://i.stack.imgur.com/WRSSV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WRSSV.png" alt="docker tasks"></a></p>
  
  <p>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?</p>