Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 15, 2026·3 min de lectura

Watchtower — Automated Docker Container Image Updates

Runs as a container itself, polls registries for new image tags, and gracefully redeploys running containers when updates appear.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Watchtower Guide
Comando con revisión previa
npx -y tokrepo@latest install 1487461c-3919-11f1-9bc6-00163e2b0d79 --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

TL;DR
Watchtower monitors Docker registries and automatically updates running containers when new images are available.
§01

What it is

Watchtower is a Docker container that monitors other running containers and automatically updates them when new images are pushed to their registries. It polls container registries at configurable intervals, pulls updated images, and gracefully stops and restarts containers with the same configuration.

Watchtower targets anyone running Docker containers in production or on home servers who wants automatic updates without manual intervention. It handles the entire lifecycle: detect, pull, stop, and restart.

§02

How it saves time or tokens

Manually checking for Docker image updates and redeploying containers is tedious and easy to forget. Watchtower automates this entirely. It preserves container configurations (ports, volumes, environment variables) during updates, so you do not need to re-specify startup parameters. Notifications via email, Slack, or webhooks keep you informed about what was updated and when.

§03

How to use

  1. Start Watchtower to monitor all containers:
docker run -d --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower --interval 300 --cleanup
  1. Or monitor only specific containers by label:
# Add label to containers you want updated
docker run -d --label com.centurylinklabs.watchtower.enable=true my-app

# Run Watchtower with label filter
docker run -d --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  containrrr/watchtower --label-enable --interval 300
§04

Example

# docker-compose.yml with Watchtower
services:
  watchtower:
    image: containrrr/watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --interval 3600 --cleanup --notifications-level info
    restart: unless-stopped

  my-app:
    image: myregistry/my-app:latest
    labels:
      - com.centurylinklabs.watchtower.enable=true
    ports:
      - '8080:8080'
    restart: unless-stopped
§05

Related on TokRepo

This tool integrates with standard development workflows and requires minimal configuration to get started. It is available as open-source software with documentation and community support through the official repository. The project follows semantic versioning for stable releases.

For teams evaluating this tool, the key advantage is reducing manual work in repetitive tasks. The automation provided by the built-in features means less custom code to maintain and fewer integration points to manage. This translates directly to lower maintenance costs and faster iteration cycles.

§06

Common pitfalls

  • Watchtower requires access to the Docker socket (/var/run/docker.sock), which grants full control over all containers; restrict access and do not expose it on untrusted networks.
  • Automatic updates can introduce breaking changes; use specific image tags or a staging environment rather than :latest in production to control when updates apply.
  • The --cleanup flag removes old images after updates to prevent disk space buildup; without it, old images accumulate over time.

Preguntas frecuentes

Does Watchtower work with private registries?+

Yes. Watchtower supports private Docker registries with authentication. Mount your Docker config.json file or set registry credentials via environment variables so Watchtower can pull from private repositories.

Can I exclude containers from updates?+

Yes. Use the --label-enable flag to only update containers with a specific label. Alternatively, add the com.centurylinklabs.watchtower.enable=false label to containers you want to exclude.

Does Watchtower cause downtime during updates?+

There is a brief period between stopping the old container and starting the new one. For zero-downtime updates, you need a load balancer and multiple container instances. Watchtower is best suited for single-instance containers where brief interruptions are acceptable.

How does Watchtower send notifications?+

Watchtower supports email, Slack, Microsoft Teams, Gotify, and webhook notifications. Configure notification settings via environment variables or command-line flags.

Is Watchtower safe for production use?+

Watchtower is widely used in production, especially for home servers and small deployments. For mission-critical production systems, consider using CI/CD pipelines with manual approval gates instead of fully automated updates.

Referencias (3)

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados