I am using the azure devops pipeline to build a docker image for my asp.net web application. I have to use self-hosted agent as build and deployment server. After each time running the CI pipeline, new images are created and then pushed to Docker registry. now the problem is , the images which are built and saved on the agent! after a while the agent disk faces the low disk and I have to delete the old images manually. How can I delete docker images after pushing to the registry during the CI pipeline?
4 Answers
1
votes
0
votes
0
votes
0
votes
How about using docker system prune
. Doing this usually removes all dangling images from the system but using it with -a
should take care of removing any unused images as well.
Please refer to official documentation here .