Skip to content

k3s

see also some kubernetes / k8s stuff:

cleanup unused images

that's how things start. cleanup unused images, sometimes I need to do that and besides what kubernetes things since other stuff is also running on the same system (I know).

list images:

sudo k3s crictl images

delete images not currently in use:

sudo k3s crictl rmi --prune

source

delete individual image

sudo k3s crictl rmi docker.pkg.dev/package/packagename:latest

import docker / container image

docker save localhost/shaarli | sudo k3s ctr images import -

you can also run docker save -o filename localhost/your-local-image to save the image as a file, move it around and import it then via k3s ctr images import filename

how to use it in a kubernetes yaml file:

containers:
- image: localhost/shaarli:latest
  imagePullPolicy: Never