Skip to content

Commit 97b61ce

Browse files
authored
Merge pull request Kaggle#776 from Kaggle/delete-old-tagged-images-jenkins
Delete old tagged images from Jenkins GPU worker
2 parents f22bf58 + 1118186 commit 97b61ce

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ pipeline {
6464
steps {
6565
sh '''#!/bin/bash
6666
set -exo pipefail
67-
docker image prune -f # remove previously built image to prevent disk from filling up
67+
# Remove images (dangling or not) created more than 120h (5 days ago) to prevent disk from filling up.
68+
docker image prune --all --force --filter "until=120h"
69+
# Remove any dangling images (no tags).
70+
# All builds for the same branch uses the same tag. This means a subsequent build for the same branch
71+
# will untag the previously built image which is safe to do. Builds for a single branch are performed
72+
# serially.
73+
docker image prune -f
6874
./build --gpu --base-image-tag ${STAGING_TAG} | ts
6975
./push --gpu ${PRETEST_TAG}
7076
'''

0 commit comments

Comments
 (0)