-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: add options to builder prune #1327
build: add options to builder prune #1327
Conversation
d2c48d1
to
8d4de02
Compare
Codecov Report
@@ Coverage Diff @@
## master #1327 +/- ##
==========================================
- Coverage 54.82% 54.64% -0.19%
==========================================
Files 292 293 +1
Lines 19267 19360 +93
==========================================
+ Hits 10564 10580 +16
- Misses 8044 8119 +75
- Partials 659 661 +2 |
e89e1c3
to
82ee8e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
82ee8e1
to
cd5550b
Compare
cli/command/formatter/buildcache.go
Outdated
sort.Slice(buildCache, func(i, j int) bool { | ||
lui, luj := buildCache[i].LastUsedAt, buildCache[j].LastUsedAt | ||
switch { | ||
case lui == luj: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit nil check is more readable
cli/command/formatter/buildcache.go
Outdated
case lui.Equal(*luj): | ||
return strings.Compare(buildCache[i].ID, buildCache[j].ID) < 0 | ||
} | ||
return lui.Before(*luj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: default:
cli/command/formatter/disk_usage.go
Outdated
for _, v := range ctx.BuildCache { | ||
t.Execute(ctx.Output, *v) | ||
if !v.Shared { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't filter in here, but in the summary bytes.
This patch adds --filter, --keep-storage, --all and --force to builder prune. Signed-off-by: Tibor Vass <tibor@docker.com>
3c46602
to
b774911
Compare
Signed-off-by: Tibor Vass <tibor@docker.com>
b774911
to
ca608c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
Signed-off-by: Tibor Vass tibor@docker.com
Related to moby/moby#37651
This patch fixes the UX around build cache:
--filter
,--keep-storage
,--all
,--force
. This is needed to to avoid situations where user needs to prune all their cache, and they can thus prune only a subset of their cache.system df
consistent with the way other types are shown (containers, images, volumes...)