This commit is contained in:
2024-12-25 20:13:02 +01:00
parent eff6338f71
commit 0fcccf93b0
131 changed files with 20710 additions and 106 deletions

View File

@@ -0,0 +1,35 @@
module herocontainers
import freeflowuniverse.herolib.osal { exec }
import time
import freeflowuniverse.herolib.virt.utils
import freeflowuniverse.herolib.ui.console
// TODO: needs to be implemented for buildah, is still code from docker
@[heap]
pub struct Image {
pub mut:
repo string
id string
id_full string
tag string
digest string
size int // size in MB
created time.Time
engine &CEngine @[skip; str: skip]
}
// delete podman image
pub fn (mut image Image) delete(force bool) ! {
mut forcestr := ''
if force {
forcestr = '-f'
}
exec(cmd: 'podman rmi ${image.id} ${forcestr}', stdout: false)!
}
// export podman image to tar.gz
pub fn (mut image Image) export(path string) !string {
exec(cmd: 'podman save ${image.id} > ${path}', stdout: false)!
return ''
}