Docker prune cron job or menu option.

barryclamsworth

PG Captain
Super Moderator
Feb 2, 2018
399
285
Reactions
285 0 0
#1
I freshly installed my server about a month ago and cleared out all my unused old docker images today. Reclaimed about 40GB. This could be fairly significant for those on a bottom end budget VPS.

Perhaps there is a built in docker space saving limit but if not it might be nice for a monthly cron job or something to remove these unused images or perhaps a menu item in plexguide for those with cmdlinephobia.

sudo docker image prune -a
 

Deiteq

Administrator
Project Manager
Jan 19, 2018
288
196
Reactions
196 0 0
#2
Awesome fix!
Thanks for that!:D
Maybe throw it in with watchtower if not on it's own cron job!:geek:

docker-purge.JPG
 

FeralF

PG Overlord
Tech Support
May 30, 2018
30
14
Reactions
14 0 0
#3
I freshly installed my server about a month ago and cleared out all my unused old docker images today. Reclaimed about 40GB. This could be fairly significant for those on a bottom end budget VPS.

Perhaps there is a built in docker space saving limit but if not it might be nice for a monthly cron job or something to remove these unused images or perhaps a menu item in plexguide for those with cmdlinephobia.

sudo docker image prune -a
Absolute legend. Was deleting them manually the other day, feels like a right div now. Big up on the big help 👍
 

Deiteq

Administrator
Project Manager
Jan 19, 2018
288
196
Reactions
196 0 0
#4

Stupifier

PG Elite
Tech Support
Mar 18, 2018
149
69
Reactions
69 0 0
#5
So if I type in prune it will remove any unused docker images?
 

Deiteq

Administrator
Project Manager
Jan 19, 2018
288
196
Reactions
196 0 0
#6
You will have to update to dev first then run:
sudo ansible-playbook /opt/plexguide/ansible/critical.yml --tags alias
to make sure the aliases get updated if PlexGuide didn't ask you to reinstall!;)


After that the new shortcut commands will work!

UPDATE: You now only need to sudo pgdev for the preinstaller to run so alias gets updated!:)
 
Last edited:
Assists Greatly with Development Costs

Indagatrix

PG Veteran
Tech Support
Jun 7, 2018
13
5
Reactions
5 0 0
#8
What lookup can i make to determine what is "unused"?
Is it trash from removing opt/appdata installs or am i on the wrong thought train?
 

Deiteq

Administrator
Project Manager
Jan 19, 2018
288
196
Reactions
196 0 0
#9
What lookup can i make to determine what is "unused"?
Is it trash from removing opt/appdata installs or am i on the wrong thought train?
Are you referring to prune or autoremove?
 

Deiteq

Administrator
Project Manager
Jan 19, 2018
288
196
Reactions
196 0 0
#11
prune removes old container images that are not being used due to updates or use of another maintainers container!
 
Last edited:

barryclamsworth

PG Captain
Super Moderator
Feb 2, 2018
399
285
Reactions
285 0 0
#12
What lookup can i make to determine what is "unused"?
Prune will only delete things that aren't in use by a container, it's sort of like a file lock when a file is in use. You can view all images and their status in portainer.

Or from the command line...

sudo docker ps -a - Show images and status (stretch your window out wide and re-run if using putty)

You can remove individual images using their IMAGE ID.

sudo docker rmi (image ID) - The rmi = ReMove Image