Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6367cd13
Commit
6367cd13
authored
Apr 26, 2016
by
Jeff Grafton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only remove day+ old containers in Jenkins daily cleanup
parent
3b09c641
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
jenkins-daily-maintenance.yaml
hack/jenkins/job-configs/jenkins-daily-maintenance.yaml
+4
-1
No files found.
hack/jenkins/job-configs/jenkins-daily-maintenance.yaml
View file @
6367cd13
...
@@ -9,8 +9,11 @@
...
@@ -9,8 +9,11 @@
gcloud components update
gcloud components update
gcloud components update alpha
gcloud components update alpha
gcloud components update beta
gcloud components update beta
# Select only exited or dead containers that weren't created today.
# A sort of work-around for https://github.com/kubernetes/kubernetes/issues/24661
containers_to_remove=($(docker ps -a -f 'status=exited' -f 'status=dead' --format='{{.CreatedAt}}\t{{.ID}}' | grep -v ^$(date +%Y-%m-%d) | cut -f2 || true))
# Copied from http://blog.yohanliyanage.com/2015/05/docker-clean-up-after-yourself/
# Copied from http://blog.yohanliyanage.com/2015/05/docker-clean-up-after-yourself/
docker rm -v
$(docker ps -a -q -f 'status=exited' -f 'status=dead')
|| true
docker rm -v
"${containers_to_remove[@]:+${containers_to_remove[@]}}"
|| true
docker rmi $(docker images -q -f 'dangling=true') || true
docker rmi $(docker images -q -f 'dangling=true') || true
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment