-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: cron job for pruning docker images #11
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following line to schedule the job: | ||
|
||
``` | ||
0 */4 * * * /home/azureuser/prune_docker_images.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally you don't want scripts laying around in a home folder. You usually put them in say ~/.local/bin, etc.
But since we're going to develop this further to be part of Dokku plugin ecosystem, I guess we can leave it here for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 mostly LGTM. I agree with @kilemensi , since docker system prune
gives you a --volumes option, no need to have them as two separate commands
-f, --force Do not prompt for confirmation
--volumes Prune anonymous volumes
I've learnt its never a good idea to have sudo within scripts; you can have a check if script is being run as a user with sudo
privileges.
I have realized that running the script directly with |
@VinneyJ why would this not work, any error logs? |
No stdout log at all, @thepsalmist. Nothing appears even in the logs file. |
Description
This change introduces a scheduled cron job on the Dev server to automatically prune unused Docker images every 4 hours. The main objective is to manage disk space efficiently by removing old and unused Docker images, thus preventing potential space-related issues that can cause PRs to fail. This maintenance task ensures that the development environment remains clean and that only relevant Docker images are retained.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Checklist: