我是 docker 和 jenkins 的新手。但是最终我在 jenkins 中创建了一个作业,以便我可以删除存储在我们的 linux 机器(CentOS7)中的 gitlab-runner 的卷缓存
为了实现这一点,我每 6 小时在 jenkins 中使用以下命令创建一个定期作业:
docker volume prune -f
Run Code Online (Sandbox Code Playgroud)
但是它根本不清理空间。这是詹金斯工作的输出:
Started by timer
Running as SYSTEM
Building remotely on buildbng17 (gitlab) in workspace /mnt/data0/jenkins/workspace/gitlab-cleanup
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
[gitlab-cleanup] $ /bin/sh -xe /tmp/jenkins3799570002967825583.sh
+ find /mnt/data0/gitlab/data/backups/ -name '*.tgz' -mtime +30
/mnt/data0/gitlab/data/backups/etc-gitlab-1611415968.tgz
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of …Run Code Online (Sandbox Code Playgroud)