MCPcopy Create free account
hub / github.com/docker/cli / pruneFn

Function pruneFn

cli/command/container/prune.go:103–113  ·  view source on GitHub ↗

pruneFn calls the Container Prune API for use in "docker system prune", and returns the amount of space reclaimed and a detailed output string.

(ctx context.Context, dockerCLI command.Cli, options pruner.PruneOptions)

Source from the content-addressed store, hash-verified

101// pruneFn calls the Container Prune API for use in "docker system prune",
102// and returns the amount of space reclaimed and a detailed output string.
103func pruneFn(ctx context.Context, dockerCLI command.Cli, options pruner.PruneOptions) (uint64, string, error) {
104 if !options.Confirmed {
105 // Dry-run: perform validation and produce confirmation before pruning.
106 confirmMsg := "all stopped containers"
107 return 0, confirmMsg, cancelledErr{errors.New("containers prune has been cancelled")}
108 }
109 return runPrune(ctx, dockerCLI, pruneOptions{
110 force: true,
111 filter: options.Filter,
112 })
113}

Callers

nothing calls this directly

Calls 1

runPruneFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…