Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImageUnreferencedRemove ¶
func ImageUnreferencedRemove() (err error)
ImageUnreferencedRemove (English): Image garbage collector
ImageUnreferencedRemove (Português): Coletor de lixo das imagens
Example ¶
var err error var list []types.ImageSummary err = ImageUnreferencedRemove() if err != nil { panic(err) } var dockerSys = iotmakerdocker.DockerSystem{} err = dockerSys.Init() if err != nil { panic(err) } list, err = dockerSys.ImageList() if err != nil { panic(err) } for _, image := range list { if len(image.RepoTags) > 0 { if image.RepoTags[0] == "<none>:<none>" { fmt.Println("test fail") return } } }
Output:
func RemoveAllByNameContains ¶
RemoveAllByNameContains (English): Use this function to remove unnecessary after testing. This function removes container, image and network by name and unlinked volumes and imagens
RemoveAllByNameContains (Português): Use esta função para remover o desnecessário depois dos testes. Esta função remove containers, imagens e rede por nome e volumes e imagens sem uso.
func VolumesUnreferencedRemove ¶
func VolumesUnreferencedRemove() (err error)
Remove unreferenced volumes
Example ¶
var err error var volumes []types.Volume var counterUnreferencedVolumes = 0 var dockerSys = iotmakerdocker.DockerSystem{} err = dockerSys.Init() if err != nil { panic(err) } volumes, err = dockerSys.VolumeList() if err != nil { panic(err) } for _, volumeData := range volumes { if volumeData.UsageData == nil || volumeData.UsageData.RefCount == -1 { counterUnreferencedVolumes += 1 } } if counterUnreferencedVolumes == 0 { return } err = VolumesUnreferencedRemove() if err != nil { panic(err) } counterUnreferencedVolumes = 0 volumes, err = dockerSys.VolumeList() if err != nil { panic(err) } for _, volumeData := range volumes { if volumeData.UsageData == nil || volumeData.UsageData.RefCount == -1 { counterUnreferencedVolumes += 1 } } if counterUnreferencedVolumes != 0 { fmt.Println("test fail") }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.