Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cli/command/builder/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
}

report, err := dockerCli.Client().BuildCachePrune(ctx, build.CachePruneOptions{
All: options.all,
KeepStorage: options.keepStorage.Value(), // FIXME(thaJeztah): rewrite to use new options; see https://github.com/moby/moby/pull/48720
Filters: pruneFilters,
All: options.all,
// TODO(austinvazquez): remove when updated to use github.com/moby/moby/client@v0.1.0
// See https://github.com/moby/moby/pull/50772 for more details.
KeepStorage: options.keepStorage.Value(),
ReservedSpace: options.keepStorage.Value(),
Filters: pruneFilters,
})
if err != nil {
return 0, "", err
Expand Down
6 changes: 4 additions & 2 deletions cli/command/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,10 @@ func NewDockerCli(ops ...CLIOption) (*DockerCli, error) {
ops = append(defaultOps, ops...)

cli := &DockerCli{baseCtx: context.Background()}
if err := cli.Apply(ops...); err != nil {
return nil, err
for _, op := range ops {
if err := op(cli); err != nil {
return nil, err
}
}
return cli, nil
}
Expand Down
Loading