Skip to main content

Overview

Diun (Docker Image Update Notifier) is a service that automatically monitors Docker container images and sends notifications when updates are detected. This document covers the deployment and configuration of Diun using Docker Compose.

Service Details

Architecture

Diun operates as a standalone container with the following connections:
  • Docker Socket: Diun monitors running containers via the Docker socket
  • Persistent Data: State is maintained across restarts using a Docker volume
  • Notifications: Updates are sent to Discord via webhooks

Prerequisites

  • Docker Engine (24.0+)
  • Docker Compose v2
  • Discord server with webhook permissions (for notifications)
  • Running containers with the diun.enable=true label

Environment Variables

Create a .env file with the following variable:
Never commit the .env file to version control. Store your webhook URL securely in a password manager.

Deployment Configuration

Docker Compose File

Deployment Instructions

  1. Create the deployment directory:
  2. Create the docker-compose.yml and .env files:
  3. Deploy the service:
  4. Verify the service is running:

Configuration Highlights

Watch Settings

Diun is configured with the following watch parameters:
  • Schedule: Every hour (0 * * * * cron expression)
  • Workers: 20 concurrent image checks
  • Jitter: 30-second random delay to avoid API rate limits

Notification Setup

Notifications are configured to:
  • Send to Discord via webhook
  • Mention @here for visibility
  • Include detailed image update information

Enabling Monitoring for Containers

To monitor a container for updates, add the following label to its configuration:

Advanced Container Monitoring

You can add additional labels to customize monitoring:

Example: Monitoring Multiple Services

Here’s an example of enabling Diun monitoring for several containers:

Maintenance

Backup Strategy

Back up Diun’s data regularly:

Updates

To update Diun:
  1. Update the image tag in docker-compose.yml
  2. Apply the update:
  3. Check logs for any issues:

Troubleshooting

No Notifications

If you’re not receiving notifications:
  1. Verify Discord webhook URL is correct:
  2. Check if Diun is running on schedule:
  3. Test the webhook manually:

No Images Being Monitored

If no images are being monitored:
  1. Verify Docker socket access:
  2. Check container discovery logs:
  3. Ensure containers have the proper diun.enable=true label

Image Update Triggers

Diun identifies image updates by:
  1. Tag Changes: When an image with a specific tag is updated
  2. New Tags: When configured to watch repositories for new tags
  3. Manifest Changes: When the image digest changes, even if the tag remains the same

Manual Update Check

To trigger an immediate update check:

Security Considerations

  • Docker Socket: Diun has access to the Docker socket, granting it significant privileges
  • Discord Webhook: Keep your webhook URL confidential to prevent unauthorized notifications
  • Image Policies: Consider using diun.include_tags to only monitor production tags

Additional Resources

Integration Examples

Complete Stack Example

Add Diun labels to your existing infrastructure: