- Use
ncdu -x
to get an overview for disk usage. - Use
podman system df
to get an overview for prune savings. - Delete old, tagged, unwanted images from
podman image list
w/podman rmi [imagename]
. - Do a
podman ps -a
and ensure every container to keep features theto-keep
label mnemonic for filtering. Workflow to add it follows:
- Commit the [stopped] container
podman commit container_name container_name-tokeep
- Rename the existing container so we can use existing --name and test before deleting
podman rename container_name container_name_old
- Use inspect to get previous run/create parameters for duplication
podman inspect --format '{{range .Config.CreateCommand}}{{.}} {{end}}' container_name_old
- Create or run the NEW '-tokeep' image
podman create --label to-keep=true [(bind,port,env,--name,etc args from the previous command)] container_name-tokeep /bin/whatever
- Test
podman start container_name -ai (or whatever)
- Delete backup
podman rm container_name_old
- Prune [stopped] containers without our "to-keep" label
podman container prune --filter "label!=to-keep=true"
- Prune "dangling" images (basically, anything w/o a label)
podman image prune