Documentation ¶
Index ¶
- func FormatDockerImageID(s string, maxLen int) string
- func FormatLabels(labels map[string]string) string
- func FormatSize(bytes int64) string
- func MeasureExecutionTime(f func()) string
- func RemoveDockerImage(d *DockerClient, ctx context.Context, imageID string, opts image.RemoveOptions) error
- func ToBytes(size float64, unit string) float64
- type DockerClient
- func (d *DockerClient) CleanupStoppedContainerImages() error
- func (d *DockerClient) InitDockerClient() error
- func (d *DockerClient) ListUnusedImages() ([]image.Summary, error)
- func (d *DockerClient) PrintUnusedImages() error
- func (d *DockerClient) RemoveExceedSizeLimit(sizeLimit float64, unit string) error
- func (d *DockerClient) RemoveUnusedImages(concurrent bool) error
- func (d *DockerClient) VerboseModeCleanup() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDockerImageID ¶
Helper function to truncate docker image ID with ellipsis
func FormatLabels ¶
Helper function used to format the docker image labels Key Value Pairs
func FormatSize ¶
Helper function to converts bytes to human-readable format
func RemoveDockerImage ¶
func RemoveDockerImage(d *DockerClient, ctx context.Context, imageID string, opts image.RemoveOptions) error
RemoveDockerImage
Types ¶
type DockerClient ¶
func (*DockerClient) CleanupStoppedContainerImages ¶
func (d *DockerClient) CleanupStoppedContainerImages() error
CleanupStoppedContainerImages removes images associated with stopped containers
func (*DockerClient) InitDockerClient ¶
func (d *DockerClient) InitDockerClient() error
InitDockerClient initializes a new Docker client
func (*DockerClient) ListUnusedImages ¶
func (d *DockerClient) ListUnusedImages() ([]image.Summary, error)
ListUnusedImages returns a list of unused Docker images
func (*DockerClient) PrintUnusedImages ¶
func (d *DockerClient) PrintUnusedImages() error
PrintUnusedImages lists the images that would be removed (Dry Run)
func (*DockerClient) RemoveExceedSizeLimit ¶
func (d *DockerClient) RemoveExceedSizeLimit(sizeLimit float64, unit string) error
Remove Images that exceed a specific size limit
func (*DockerClient) RemoveUnusedImages ¶
func (d *DockerClient) RemoveUnusedImages(concurrent bool) error
RemoveUnusedImages deletes unused Docker images
func (*DockerClient) VerboseModeCleanup ¶
func (d *DockerClient) VerboseModeCleanup() error
VerboseModeCleanup gives more details while doing the cleanup of unused images
Click to show internal directories.
Click to hide internal directories.