<p>I'm getting a low disk space warning on a server where my microk8s and applications are installed. When I run the microk8s ctr image ls command, multiple images appear for an application. Does the &quot;docker image prune -f&quot; command in Docker have an equivalent in microk8s? Or is there a way possible?</p>

sercanezelhan
<p>If you want to delete all custom added images from the built-in library, you can do this:</p>
<pre><code># get all images that start with localhost:32000, output the results into image_ls file
sudo microk8s ctr images ls name~='localhost:32000' | awk {'print $1'} &gt; image_ls 
# loop over file, remove each image
cat image_ls | while read line || [[ -n $line ]];
do
    microk8s ctr images rm $line
done;
</code></pre>
<p>Put it into a .sh file and run the script</p>
