Skip to content

Watchtower – Automatically Update a Locally Built Docker Image

Watchtower is known for automating Docker image updates from repositories. The documentation is very clear about its installation and the various parameters to configure. However, an interesting feature for those who build their images locally, without a private registry, often goes unnoticed : automatic updates when a new build is created.

Simply add the label - "com.centurylinklabs.watchtower.no-pull=true" to the service you build in your docker‑compose.yml, and at the scheduled time you have chosen, the container will update itself along with any other registry‑based dependencies.

Example

services:
randomapp:
image: marsante/randomapp:latest
user: ${APPUID}:${APPGUID}
environment:
- TZ=${TZ}
labels:
- "com.centurylinklabs.watchtower.no-pull=true"

You can automate the image build with a cron job (or any scheduler) so you no longer have to worry about updating it manually.