2016-09-22 17:04:34 -04:00
|
|
|
package prune
|
|
|
|
|
|
|
|
import (
|
2017-04-17 18:07:56 -04:00
|
|
|
"github.com/docker/cli/cli/command"
|
|
|
|
"github.com/docker/cli/cli/command/container"
|
|
|
|
"github.com/docker/cli/cli/command/image"
|
|
|
|
"github.com/docker/cli/cli/command/network"
|
|
|
|
"github.com/docker/cli/cli/command/volume"
|
2016-12-07 17:02:13 -05:00
|
|
|
"github.com/docker/docker/opts"
|
2016-09-22 17:04:34 -04:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// NewContainerPruneCommand returns a cobra prune command for containers
|
2016-09-22 17:04:34 -04:00
|
|
|
func NewContainerPruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|
|
|
return container.NewPruneCommand(dockerCli)
|
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// NewVolumePruneCommand returns a cobra prune command for volumes
|
2016-09-22 17:04:34 -04:00
|
|
|
func NewVolumePruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|
|
|
return volume.NewPruneCommand(dockerCli)
|
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// NewImagePruneCommand returns a cobra prune command for images
|
2016-09-22 17:04:34 -04:00
|
|
|
func NewImagePruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|
|
|
return image.NewPruneCommand(dockerCli)
|
|
|
|
}
|
|
|
|
|
2016-10-18 00:36:52 -04:00
|
|
|
// NewNetworkPruneCommand returns a cobra prune command for Networks
|
|
|
|
func NewNetworkPruneCommand(dockerCli *command.DockerCli) *cobra.Command {
|
|
|
|
return network.NewPruneCommand(dockerCli)
|
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// RunContainerPrune executes a prune command for containers
|
2016-12-07 17:02:13 -05:00
|
|
|
func RunContainerPrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
|
|
|
return container.RunPrune(dockerCli, filter)
|
2016-09-22 17:04:34 -04:00
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// RunVolumePrune executes a prune command for volumes
|
2016-12-07 17:02:13 -05:00
|
|
|
func RunVolumePrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
2017-02-04 12:10:05 -05:00
|
|
|
return volume.RunPrune(dockerCli, filter)
|
2016-09-22 17:04:34 -04:00
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// RunImagePrune executes a prune command for images
|
2016-12-07 17:02:13 -05:00
|
|
|
func RunImagePrune(dockerCli *command.DockerCli, all bool, filter opts.FilterOpt) (uint64, string, error) {
|
|
|
|
return image.RunPrune(dockerCli, all, filter)
|
2016-09-22 17:04:34 -04:00
|
|
|
}
|
2016-10-18 00:36:52 -04:00
|
|
|
|
|
|
|
// RunNetworkPrune executes a prune command for networks
|
2016-12-07 17:02:13 -05:00
|
|
|
func RunNetworkPrune(dockerCli *command.DockerCli, filter opts.FilterOpt) (uint64, string, error) {
|
|
|
|
return network.RunPrune(dockerCli, filter)
|
2016-10-18 00:36:52 -04:00
|
|
|
}
|