Skip to content
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

Auto Image delete #122

Closed
awptechnologies opened this issue Dec 2, 2023 · 6 comments
Closed

Auto Image delete #122

awptechnologies opened this issue Dec 2, 2023 · 6 comments
Labels

Comments

@awptechnologies
Copy link

How do i configure shepherd to not keep any old images? Rn i have image keep set to 1 but i would like it to delete any old images after updating. Is that a possibility? Can i just put the value to 0?

@moschlar
Copy link
Collaborator

moschlar commented Dec 3, 2023

I haven't personally tested it, but setting IMAGE_AUTOCLEAN_LIMIT: 0 should do the trick.

But keep in mind, that the image autoclean functionality currently only runs on the node where the shepherd container itself runs: #84

@moschlar moschlar closed this as completed Dec 3, 2023
@awptechnologies
Copy link
Author

is there anyway to get it to run cluster wide?

@moschlar
Copy link
Collaborator

moschlar commented Dec 5, 2023

Maybe, swarm-cronjob has gotten more reliable when running jobs in global mode, so I would recommend you should try it out like described in https://crazymax.dev/swarm-cronjob/examples/prune-swarm-nodes/.

But maybe it is not already fixed:
crazy-max/swarm-cronjob#20
🤔

@djmaze
Copy link
Collaborator

djmaze commented Dec 6, 2023

No, swarm-cronjob probably does not work yet with global mode.

In order to not have to work around this limitation anymore, I just built a new service which you can just run separately in global mode: https://github.com/djmaze/docker-autoprune

@martadinata666
Copy link

I'm using swarm-cronjob and it works pretty well. But I'm not using that setting with the issue attached to a minimal 2 nodes with 1 manager.

@djmaze
Copy link
Collaborator

djmaze commented Dec 7, 2023

Just tried with swarm-cronjob again. With 3 (manager-only) nodes, it still only runs the job on 2 of them. Tested on Docker v20 as well as v24. So the problem described in crazy-max/swarm-cronjob#20 still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants