File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,16 @@ To determine what to delete we will use information stored in /var/lib/docker/di
15
15
CLEAN_PERIOD_BUILDS - we will launch clean if last clean was more than CLEAN_PERIOD_SECONDS seconds ago
16
16
or there was more than CLEAN_PERIOD_BUILDS nuilds since last build
17
17
18
- IMAGE_RETAIN_PERIOD - we will not delete images if they have events since ` current_timestamp - IMAGE_RETAIN_PERIOD ` (default 3d )
19
- VOLUMES_RETAIN_PERIOD - we will not delete volumes if they have events since ` current_timestamp - IMAGE_RETAIN_PERIOD ` (default 3d )
18
+ IMAGE_RETAIN_PERIOD - we will not delete images if they have events since ` current_timestamp - IMAGE_RETAIN_PERIOD ` (default 4h )
19
+ VOLUMES_RETAIN_PERIOD - we will not delete volumes if they have events since ` current_timestamp - IMAGE_RETAIN_PERIOD ` (default 4h )
20
20
21
21
####### defaults:
22
- CLEAN_PERIOD_SECONDS=${CLEAN_PERIOD_SECONDS:-21600} # 6 hours
23
- CLEAN_PERIOD_BUILDS=${CLEAN_PERIOD_BUILDS:-10}
24
- IMAGE_RETAIN_PERIOD=${IMAGE_RETAIN_PERIOD:-259200}
25
- VOLUMES_RETAIN_PERIOD=${VOLUMES_RETAIN_PERIOD:-259200}
22
+ CLEAN_PERIOD_SECONDS: '21600' # launch clean if last clean was more than CLEAN_PERIOD_SECONDS seconds ago
23
+ CLEAN_PERIOD_BUILDS: '5' # launch clean if last clean was more CLEAN_PERIOD_BUILDS builds since last build
24
+ IMAGE_RETAIN_PERIOD: '14400' # do not delete docker images if they have events since current_timestamp - IMAGE_RETAIN_PERIOD
25
+ VOLUMES_RETAIN_PERIOD: '14400' # do not delete docker volumes if they have events since current_timestamp - VOLUMES_RETAIN_PERIOD
26
+ DISK_USAGE_THRESHOLD: '0.8' # launch clean based on current disk usage DISK_USAGE_THRESHOLD
27
+ INODES_USAGE_THRESHOLD: '0.8' # launch clean based on current inodes usage INODES_USAGE_THRESHOLD
26
28
27
29
##### Logic:
28
30
- save current docker events by ` docker events --until 0s -f ${EVENT_FORMAT} > /var/lib/docker/dind-volume/events/$(date +%s) `
You can’t perform that action at this time.
0 commit comments