-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused images #3490
Comments
Portainer cannot do that. Put your above commands into a script and create a cronjob for the script. |
I don't know if you understood but my script example above is a cron job, and unused images are not clean when it runs, I can only remove images if I go to portainer and remove it manually. |
You can use |
@christronyxyocum Portainer does in fact have cron job functionality.
I just tested this example on Portainer 1.23 to remove un-used images and it worked as intended. |
Here is a command that you can perhaps modify to your liking, this will delete images older than 24 hours Note that |
I'll close this as I believe i have answered the question. If needed I can re-open to discuss further |
I'm having problems with this configuration, I've added the host jobs as suggested, using If I manually launch the container I receive this error: I've noticed that the CMD of the container is By the way, it's not clear to me if this command is executed just on the host node or everywhere |
Never use latest tag, I have the same problem with the ubuntu:latest image, but if you use ubuntu:18.04 it'll work. You can set endpoints in "Target endpoints" section (above the Create sections button) . |
@kungl you saved me! Thank you. I think when someone creates a new |
If you're using Watchtower to automatically update containers, and that is generating a lot of unused images, you might want to enable |
Question:
How can I remove unused images with a cron job?
Current i have this kind of script running:
But when i check images list in portainer browser, the unused images are there. So how can i remove periodically unused images on portainer to free space?
The text was updated successfully, but these errors were encountered: