azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.65k stars 130 forks source link

[FEAT]: Container Images Management #272

Open mandopatriot opened 4 months ago

mandopatriot commented 4 months ago

Feature Description

Similar to Containers, Volumes, and Networks, there should be an Images tab under ServApps for listing and management of images. Also, there should be an option to periodically or by selection to clean images that are no longer used - if containers are set to auto update, the old images are not pruned without going into the host and manually doing it.

azukaar commented 4 months ago

FYI Images are periodically pruned already

mandopatriot commented 4 months ago

Thanks, I that something Cosmos does? What are the details for time, etc?

azukaar commented 4 months ago

Yes, it's every night, can be disabled in the setting page

mandopatriot commented 4 months ago

I don't know if it is working properly. When I run docker images, I see old images for containers that I've removed from Cosmos. I even tested that after your original reply. Also, running docker image prune shows a good number of images that can be pruned, more than any that may have auto updated. Finally, running docker image prune -a gets rid of any image not connected to a container, which at this run saved around 6GB.

Anyway, having these options and details in Cosmos would be nice, even if it does some of it automatically.

azukaar commented 4 months ago

You can see in the logs, you should either have

"Error pruning images"

or

"Pruned images: "

appearing in them

mandopatriot commented 4 months ago

You can see in the logs, you should either have

"Error pruning images"

or

"Pruned images: "

appearing in them

It shows as pruning images but I just confirmed that not all images were pruned. After your comment I installed two different containers from the Market, then deleted them. Just now I ran docker image prune -an and it found the leftover images from the containers I deleted. So it’s been 2 days and neither auto run cleaned them. I understand not all auto tasks may or should be as impactful as docker image prune -a, which is why I suggested a page similar to Networks and Volumes, where we can manage them without going into the host directly.

azukaar commented 4 months ago

Hmm it might just be a bug to be honest, I will investigate, thanks