Hi,
I cant remember if i have asked this question or not, by the looks of it i haven't
So i am using Watchtower to update my portainer images, is there a way to set it up so that once a month it clears out the old images?
Hi,
I cant remember if i have asked this question or not, by the looks of it i haven't
So i am using Watchtower to update my portainer images, is there a way to set it up so that once a month it clears out the old images?
Not once a month: https://containrrr.dev/watchtower/arguments/#cleanup
Or run a scheduled job to clean up.
Please consider to add a cron job: [HOWTO] free / prune space used by dockers
Or run a scheduled job to clean up.
Would you be able to help with this?
Would you be able to help with this?
version: "2"
services:
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_POLL_INTERVAL=21600
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
Alles anzeigen
The interval is in seconds. Since there's 3600 seconds in an hour, so in the above example watchtower will run every 6hrs, downloading new images and purging old ones. Just keep in mind if the container restarts for any reason, the interval restarts.
My watchtower log from the last few days. You can see when it checks for new images at the said interval, if it downloads a new image, it deletes the old one at that time.
time="2021-07-08T21:28:48-04:00" level=info msg="Watchtower 1.3.0\nUsing no notifications\nChecking all containers (except explicitly disabled with label)\nScheduling first run: 2021-07-09 03:28:48 -0400 EDT\nNote that the first check will be performed in 5 hours, 59 minutes, 59 seconds",
time="2021-07-10T03:29:03-04:00" level=info msg="Found new ghcr.io/linuxserver/mariadb:latest image (5ffe6d171e1b)",
time="2021-07-10T03:29:04-04:00" level=info msg="Found new ghcr.io/linuxserver/mariadb:latest image (5ffe6d171e1b)",
time="2021-07-10T03:29:07-04:00" level=info msg="Stopping /piwigodb (7b9dba775f4c) with SIGTERM",
time="2021-07-10T03:29:16-04:00" level=info msg="Stopping /nextclouddb (252add8f260f) with SIGTERM",
time="2021-07-10T03:29:21-04:00" level=info msg="Creating /nextclouddb",
time="2021-07-10T03:29:23-04:00" level=info msg="Creating /piwigodb",
time="2021-07-10T03:29:25-04:00" level=info msg="Removing image e829bfcf6e5a",
time="2021-07-11T09:29:01-04:00" level=info msg="Found new ghcr.io/linuxserver/heimdall:latest image (4f55e34a17b6)",
time="2021-07-11T09:29:04-04:00" level=info msg="Stopping /heimdall (61afb9a0d79c) with SIGTERM",
time="2021-07-11T09:29:13-04:00" level=info msg="Creating /heimdall",
time="2021-07-11T09:29:15-04:00" level=info msg="Removing image c1ce9134f7bc",
time="2021-07-11T15:29:10-04:00" level=info msg="Found new ghcr.io/linuxserver/nextcloud:latest image (e38d670949a3)",
time="2021-07-11T15:29:13-04:00" level=info msg="Stopping /nextcloud (fd1f36156fc0) with SIGTERM",
time="2021-07-11T15:29:20-04:00" level=info msg="Creating /nextcloud",
time="2021-07-11T15:29:22-04:00" level=info msg="Removing image fa0c3dc11b10",
time="2021-07-11T21:29:02-04:00" level=info msg="Found new portainer/portainer-ce:latest image (865cf8021627)",
time="2021-07-11T21:29:04-04:00" level=info msg="Stopping /portainer (697a34776407) with SIGTERM",
time="2021-07-11T21:29:08-04:00" level=info msg="Creating /portainer",
time="2021-07-11T21:29:10-04:00" level=info msg="Removing image 8bd64518b976",
time="2021-07-13T03:29:05-04:00" level=info msg="Found new ghcr.io/linuxserver/piwigo:latest image (3057fea30693)",
time="2021-07-13T03:29:07-04:00" level=info msg="Stopping /piwigo (5b32c3d61c55) with SIGTERM",
time="2021-07-13T03:29:16-04:00" level=info msg="Creating /piwigo",
time="2021-07-13T03:29:18-04:00" level=info msg="Removing image 84f2539656b6",
time="2021-07-13T09:29:21-04:00" level=info msg="Found new ghcr.io/linuxserver/calibre-web:latest image (9cff9e7f1e71)",
time="2021-07-13T09:29:23-04:00" level=info msg="Stopping /calibre-web (bbeff2082215) with SIGTERM",
time="2021-07-13T09:29:33-04:00" level=info msg="Creating /calibre-web",
time="2021-07-13T09:29:34-04:00" level=info msg="Removing image 14d3d1636d14",
time="2021-07-15T21:29:17-04:00" level=info msg="Found new ghcr.io/linuxserver/swag:latest image (9ff5d41fb760)",
time="2021-07-15T21:29:22-04:00" level=info msg="Stopping /swag (c2f6cd72258f) with SIGTERM",
time="2021-07-15T21:29:30-04:00" level=info msg="Creating /swag",
time="2021-07-15T21:29:32-04:00" level=info msg="Removing image c659563fa980",
time="2021-07-18T15:29:15-04:00" level=info msg="Found new ghcr.io/linuxserver/nextcloud:latest image (69964f55bff4)",
time="2021-07-18T15:29:19-04:00" level=info msg="Stopping /nextcloud (8472deaff239) with SIGTERM",
time="2021-07-18T15:29:26-04:00" level=info msg="Creating /nextcloud",
time="2021-07-18T15:29:28-04:00" level=info msg="Removing image e38d670949a3"
Alles anzeigen
CodeAlles anzeigenversion: "2" services: watchtower: image: containrrr/watchtower:latest container_name: watchtower environment: - WATCHTOWER_CLEANUP=true - WATCHTOWER_POLL_INTERVAL=21600 volumes: - /var/run/docker.sock:/var/run/docker.sock - /etc/localtime:/etc/localtime:ro restart: unless-stopped
The interval is in seconds. Since there's 3600 seconds in an hour, so in the above example watchtower will run every 6hrs, downloading new images and purging old ones. Just keep in mind if the container restarts for any reason, the interval restarts.
My watchtower log from the last few days. You can see when it checks for new images at the said interval, if it downloads a new image, it deletes the old one at that time.
Hi,
Thank you, im assuming i just delete my current Watchtower and run this through Stacks?
Hi,
Thank you, im assuming i just delete my current Watchtower and run this through Stacks?
That should work fine.
Would you be able to help with this?
Set up a scheduled job in the GUI of OMV to run one of the commands mentioned in this thread:
Set up a scheduled job in the GUI of OMV to run one of the commands mentioned in this thread:
Does this look correct to you? i have choosen every Friday at 12pm to run "docker image prune -a -f" (Had to change from once a month to once a week due to stroage)
Yes, but watchtower_cleanup should do the same regarding dangling images.
Is watchtower_cleanup not working?
Is watchtower_cleanup not working?
...it is working if i spell it correctly "waptower_cleanup" apprently doesnt do anything
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!