-
Notifications
You must be signed in to change notification settings - Fork 857
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
Scheduled Disk Cleanup #457
Comments
It's a good suggestion, meanwhile, you can use a 3rd party solution like this one: |
In case someone ends up wanting to set up docker vacuum with caprover like I did:
{
"schemaVersion": 2,
"imageName": "marcopeg/docker-vacuum"
} |
I had this working. Unfortunately, maybe with a docker update, the image started throwing errors. Error: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?" |
if an application is set to have 0 instances, would it be at risk to be cleaned up by Vaccum(with default settings)? |
Yes please! I think this is one of the last missing pieces to make CapRover a fully setup and forget system |
Not sure if it helps, but what I do is set this in my crontab:
|
@seiyria, that might be quite dangerous. If for a reason your apps had stopped, that command will remove all your app containers too. Maybe you can redeploy but there is also a chance for Caprover to break. |
This is exactly what I do. But I also use continuous deployment model so just in case something goes wrong, I'm only one click away from a quick re-build from last git commit. So far the docker system prune option has not let me down. |
Update: This bit me. I had turned off a service to back it up then it was gone when I tried to scale it from 0 back to 1. So, I recommend nobody does this. |
As I said before, running that command is actually dangerous. As a temporary solution, I use Portainer. I log into it once in a while and remove unused images. That's a safe solution until Caprover develops a better way. |
@grantcodes |
Usually this error happens when the cpu architecture doesn't match. Are you running on an ARM server by any chance? |
Yes! I'm on Hetzner ARM64. |
You can try forking the project and use buildx, similar to how CapRover build works. We compile for all CPU architectures. Here are the relevant lines: caprover/dev-scripts/build_and_push_release.sh Lines 65 to 71 in f9d880e
|
Thank you! However, I just forked the repo and added a captain-definition file to deploy using dockerfile. It seemed faster. :) |
Is your feature request related to a problem? Please describe.
I have a Netdata monitor set up which sends me a notification when it thinks "Out of space time = 7h", which means I've probably done a bunch of deploys in a short period of time, and I should use the "Disk Cleanup" feature to remove older images.
Describe the solution you'd like
It would be great if I can schedule Disk Cleanup, say once a day, week, or month. I can set up how many recent images I want to keep, and it — like a cron job — deletes unused images automatically.
Describe alternatives you've considered
I can use an API or set up a cron job myself which hits the endpoint to clean up the disk automatically, but it's not very secure since Caprover uses a password-based authentication. It would be super useful to schedule it from within the Caprover UI.
The text was updated successfully, but these errors were encountered: