diff --git a/api/types/types.go b/api/types/types.go index 88e34223ea..57882b84e5 100644 --- a/api/types/types.go +++ b/api/types/types.go @@ -542,13 +542,13 @@ type DiskUsage struct { } // ImagesPruneConfig contains the configuration for Remote API: -// POST "/image/prune" +// POST "/images/prune" type ImagesPruneConfig struct { DanglingOnly bool } // ContainersPruneConfig contains the configuration for Remote API: -// POST "/image/prune" +// POST "/images/prune" type ContainersPruneConfig struct { } @@ -572,7 +572,7 @@ type VolumesPruneReport struct { } // ImagesPruneReport contains the response for Remote API: -// POST "/image/prune" +// POST "/images/prune" type ImagesPruneReport struct { ImagesDeleted []ImageDelete SpaceReclaimed uint64 diff --git a/cli/command/container/prune.go b/cli/command/container/prune.go index 7088038614..be67fe4ca9 100644 --- a/cli/command/container/prune.go +++ b/cli/command/container/prune.go @@ -67,7 +67,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u return } -// RunPrune call the Container Prune API +// RunPrune calls the Container Prune API // This returns the amount of space reclaimed and a detailed output string func RunPrune(dockerCli *command.DockerCli) (uint64, string, error) { return runPrune(dockerCli, pruneOptions{force: true}) diff --git a/cli/command/image/prune.go b/cli/command/image/prune.go index e5ad573130..46bd56cb10 100644 --- a/cli/command/image/prune.go +++ b/cli/command/image/prune.go @@ -83,7 +83,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u return } -// RunPrune call the Image Prune API +// RunPrune calls the Image Prune API // This returns the amount of space reclaimed and a detailed output string func RunPrune(dockerCli *command.DockerCli, all bool) (uint64, string, error) { return runPrune(dockerCli, pruneOptions{force: true, all: all}) diff --git a/cli/command/prune/prune.go b/cli/command/prune/prune.go index 0b1374eda9..fd04c590b6 100644 --- a/cli/command/prune/prune.go +++ b/cli/command/prune/prune.go @@ -8,32 +8,32 @@ import ( "github.com/spf13/cobra" ) -// NewContainerPruneCommand return a cobra prune command for containers +// NewContainerPruneCommand returns a cobra prune command for containers func NewContainerPruneCommand(dockerCli *command.DockerCli) *cobra.Command { return container.NewPruneCommand(dockerCli) } -// NewVolumePruneCommand return a cobra prune command for volumes +// NewVolumePruneCommand returns a cobra prune command for volumes func NewVolumePruneCommand(dockerCli *command.DockerCli) *cobra.Command { return volume.NewPruneCommand(dockerCli) } -// NewImagePruneCommand return a cobra prune command for images +// NewImagePruneCommand returns a cobra prune command for images func NewImagePruneCommand(dockerCli *command.DockerCli) *cobra.Command { return image.NewPruneCommand(dockerCli) } -// RunContainerPrune execute a prune command for containers +// RunContainerPrune executes a prune command for containers func RunContainerPrune(dockerCli *command.DockerCli) (uint64, string, error) { return container.RunPrune(dockerCli) } -// RunVolumePrune execute a prune command for volumes +// RunVolumePrune executes a prune command for volumes func RunVolumePrune(dockerCli *command.DockerCli) (uint64, string, error) { return volume.RunPrune(dockerCli) } -// RunImagePrune execute a prune command for images +// RunImagePrune executes a prune command for images func RunImagePrune(dockerCli *command.DockerCli, all bool) (uint64, string, error) { return image.RunPrune(dockerCli, all) } diff --git a/cli/command/system/df.go b/cli/command/system/df.go index 085d680fe8..293946c188 100644 --- a/cli/command/system/df.go +++ b/cli/command/system/df.go @@ -19,7 +19,7 @@ func NewDiskUsageCommand(dockerCli *command.DockerCli) *cobra.Command { cmd := &cobra.Command{ Use: "df [OPTIONS]", Short: "Show docker disk usage", - Args: cli.RequiresMaxArgs(1), + Args: cli.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runDiskUsage(dockerCli, opts) }, diff --git a/cli/command/system/prune.go b/cli/command/system/prune.go index 6a36fdd890..ea8a41380f 100644 --- a/cli/command/system/prune.go +++ b/cli/command/system/prune.go @@ -15,13 +15,13 @@ type pruneOptions struct { all bool } -// NewPruneCommand creates a new cobra.Command for `docker du` +// NewPruneCommand creates a new cobra.Command for `docker prune` func NewPruneCommand(dockerCli *command.DockerCli) *cobra.Command { var opts pruneOptions cmd := &cobra.Command{ Use: "prune [OPTIONS]", - Short: "Remove unused data.", + Short: "Remove unused data", Args: cli.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runPrune(dockerCli, opts) diff --git a/cli/command/volume/prune.go b/cli/command/volume/prune.go index dc2d3e25bc..a4bb0092d6 100644 --- a/cli/command/volume/prune.go +++ b/cli/command/volume/prune.go @@ -67,7 +67,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u return } -// RunPrune call the Volume Prune API +// RunPrune calls the Volume Prune API // This returns the amount of space reclaimed and a detailed output string func RunPrune(dockerCli *command.DockerCli) (uint64, string, error) { return runPrune(dockerCli, pruneOptions{force: true}) diff --git a/daemon/prune.go b/daemon/prune.go index 3790cb8d36..cdab7df1bb 100644 --- a/daemon/prune.go +++ b/daemon/prune.go @@ -11,7 +11,7 @@ import ( "github.com/docker/docker/volume" ) -// ContainersPrune remove unused containers +// ContainersPrune removes unused containers func (daemon *Daemon) ContainersPrune(config *types.ContainersPruneConfig) (*types.ContainersPruneReport, error) { rep := &types.ContainersPruneReport{} @@ -22,7 +22,7 @@ func (daemon *Daemon) ContainersPrune(config *types.ContainersPruneConfig) (*typ // TODO: sets RmLink to true? err := daemon.ContainerRm(c.ID, &types.ContainerRmConfig{}) if err != nil { - logrus.Warnf("failed to prune container %s: %v", c.ID) + logrus.Warnf("failed to prune container %s: %v", c.ID, err) continue } if cSize > 0 { @@ -35,7 +35,7 @@ func (daemon *Daemon) ContainersPrune(config *types.ContainersPruneConfig) (*typ return rep, nil } -// VolumesPrune remove unused local volumes +// VolumesPrune removes unused local volumes func (daemon *Daemon) VolumesPrune(config *types.VolumesPruneConfig) (*types.VolumesPruneReport, error) { rep := &types.VolumesPruneReport{} @@ -65,7 +65,7 @@ func (daemon *Daemon) VolumesPrune(config *types.VolumesPruneConfig) (*types.Vol return rep, err } -// ImagesPrune remove unused images +// ImagesPrune removes unused images func (daemon *Daemon) ImagesPrune(config *types.ImagesPruneConfig) (*types.ImagesPruneReport, error) { rep := &types.ImagesPruneReport{}