Skip to content

Cleanup option does not seem to work. #2103

@heyitschloehawthorne

Description

@heyitschloehawthorne

Describe the bug

I've been using watchtower for the past year or so and I really like how seamless it runs, but I've never been able to get the WATCHTOWER_CLEANUP option to work.

My docker_compose.yml is as follows.

watchtower:
image: containrrr/watchtower
container_name: watchtower
environment:
- WATCHTOWER_HTTP_API_METRICS=true
- WATCHTOWER_HTTP_API_TOKEN=censored
- WATCHTOWER_NOTIFICATION_REPORT=true
- WATCHTOWER_NOTIFICATION_URL=generic://notifiarr.com/api/v1/notification/watchtower>
- WATCHTOWER_CLEANUP=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports: - 800:8080
restart: unless-stopped

I removed and restarted the container, so I don't have the logs at the moment, but once it runs an update I'll add them to this issue. I did not see any mention of the cleanup in the logs, though.

Steps to reproduce

  1. Pull and run Watchtower using my docker_compose.yml file.
  2. Wait for a container to update.
  3. Get frustrated when your SSD fills up in three days.

Expected behavior

Cleanup option should be removing old container images upon completing updates.

Screenshots

No response

Environment

Docker 27.3.1 on Debian 12 x86_64

Your logs

time="2025-04-29T04:03:30Z" level=info msg="Watchtower 1.7.1"

time="2025-04-29T04:03:30Z" level=info msg="Using notifications: generic"

time="2025-04-29T04:03:30Z" level=info msg="Checking all containers (except explicitly disabled with label)"

time="2025-04-29T04:03:30Z" level=info msg="Scheduling first run: 2025-04-30 04:03:30 +0000 UTC"

time="2025-04-29T04:03:30Z" level=info msg="Note that the first check will be performed in 23 hours, 59 minutes, 59 seconds"

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions