If you are building a lot of images on a slave, eventually your Docker cache might just grow to huge sizes. Should have a way to request that the image be removed at the end of the build if it is no longer being used.

          [JENKINS-28608] Clean up disk space from Docker.build

          James Dumay added a comment -

          jglick theres a new cleanup command shipping in Docker that does just that https://blog.docker.com/2017/01/whats-new-in-docker-1-13/

          James Dumay added a comment - jglick theres a new cleanup command shipping in Docker that does just that https://blog.docker.com/2017/01/whats-new-in-docker-1-13/

          Jesse Glick added a comment -

          Might be useful, though I suspect it is not that simple, as whether or not it is safe to remove an image depends on how your script was using it.

          Jesse Glick added a comment - Might be useful, though I suspect it is not that simple, as whether or not it is safe to remove an image depends on how your script was using it.

          It's difficult to cleanup as the images are tagged with a hash and latest. We have configurred automatic cleaning for images and keep latest 10 versions of an image. If the images are tagged:

          REPOSITORY                                TAG                 IMAGE ID            CREATED             SIZE 
          7b677a9e07ff8b19e1311e300b6a834014cb8c7a  latest              78de005c53ba        10 seconds ago      67.4MB

          I cannot automatically clean them. They always have one version and every build will create a new image repository.

          The images are tagged by the following in the Jenkinsfile:

          agent {dockerfile true} 

          Mariska Tallandtree added a comment - It's difficult to cleanup as the images are tagged with a hash and latest. We have configurred automatic cleaning for images and keep latest 10 versions of an image. If the images are tagged: REPOSITORY                                TAG                 IMAGE ID            CREATED             SIZE 7b677a9e07ff8b19e1311e300b6a834014cb8c7a  latest              78de005c53ba        10 seconds ago      67.4MB I cannot automatically clean them. They always have one version and every build will create a new image repository. The images are tagged by the following in the Jenkinsfile: agent {dockerfile true} 

          Jiri L added a comment -

          Reporting this thing is still present in Jenkins 2.406

          Jiri L added a comment - Reporting this thing is still present in Jenkins 2.406

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: