We're using the Cloudbees Docker Build and Publish plugin to build Docker images in our Jenkins instance. The builds are working fine and we're pushing to Docker Hub successfully, but the images are sticking around on the Jenkins slave and causing space issues.
Is there an option to remove the images after a successful build and push? Thanks.
Additional Build Argumentstextfield where you can add build flags like--rm. - ivan.sim0cee7a3ced47is a parent image. Have you tried other ways to reduce your image size such as using a smaller base image, chain multipleRUNwith&&, use multiple variables forENV,EXPOSEetc. Every instruction in your Dockerfile adds a layer to your container image. - ivan.sim