Watchtower

Automatically update running Docker containers. It monitors your image registry, pulls new images, and gracefully restarts your applications with the latest version.

Keep your containerized applications up-to-date without manual intervention. Watchtower is a process that runs within its own container and monitors other running Docker containers for new image versions in your chosen registry, such as Docker Hub or a private one.

When it detects that an image has been updated, it automatically performs a series of actions to update your application. The process includes:

  • Pulling the new image from the registry.
  • Gracefully shutting down the existing container.
  • Restarting the container with the newly pulled image, ensuring all original deployment options and configurations are preserved.

This automation saves you from the tedious task of manually checking for updates and redeploying your containers. Simply deploy the Watchtower container, and it will handle the rest, ensuring your applications are always running on the latest, most secure base images.

Directory Structure

watchtower
.env
docker-compose.yml

docker-compose.yml

services:
  watchtower:
    image: containrrr/watchtower
    container_name: watchtower
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WATCHTOWER_CLEANUP=true
      - WATCHTOWER_POLL_INTERVAL=86400
      - REPO_USER=${REPO_USER}
      - REPO_PASS=${REPO_PASS}
    restart: unless-stopped

.env

# Optional: Credentials for pulling from private Docker registries
REPO_USER=your_registry_username
REPO_PASS=your_registry_password

Share:

Ad
Favicon

 

  
 

Similar to Watchtower

Favicon

 

  
  
Favicon

 

  
  
Favicon