2016-09-22 17:04:34 -04:00
|
|
|
package prune
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/docker/docker/cli/command"
|
|
|
|
"github.com/docker/docker/cli/command/container"
|
|
|
|
"github.com/docker/docker/cli/command/image"
|
2016-10-18 00:36:52 -04:00
|
|
|
"github.com/docker/docker/cli/command/network"
|
2016-09-22 17:04:34 -04:00
|
|
|
"github.com/docker/docker/cli/command/volume"
|
|
|
|
"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-09-22 17:04:34 -04:00
|
|
|
func RunContainerPrune(dockerCli *command.DockerCli) (uint64, string, error) {
|
|
|
|
return container.RunPrune(dockerCli)
|
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// RunVolumePrune executes a prune command for volumes
|
2016-09-22 17:04:34 -04:00
|
|
|
func RunVolumePrune(dockerCli *command.DockerCli) (uint64, string, error) {
|
|
|
|
return volume.RunPrune(dockerCli)
|
|
|
|
}
|
|
|
|
|
2016-10-08 06:38:25 -04:00
|
|
|
// RunImagePrune executes a prune command for images
|
2016-09-22 17:04:34 -04:00
|
|
|
func RunImagePrune(dockerCli *command.DockerCli, all bool) (uint64, string, error) {
|
|
|
|
return image.RunPrune(dockerCli, all)
|
|
|
|
}
|
2016-10-18 00:36:52 -04:00
|
|
|
|
|
|
|
// RunNetworkPrune executes a prune command for networks
|
|
|
|
func RunNetworkPrune(dockerCli *command.DockerCli) (uint64, string, error) {
|
|
|
|
return network.RunPrune(dockerCli)
|
|
|
|
}
|