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
-
Create the deployment directory:
-
Create the
docker-compose.yml and .env files:
-
Deploy the service:
-
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:
-
Update the image tag in
docker-compose.yml
-
Apply the update:
-
Check logs for any issues:
Troubleshooting
No Notifications
If you’re not receiving notifications:
-
Verify Discord webhook URL is correct:
-
Check if Diun is running on schedule:
-
Test the webhook manually:
No Images Being Monitored
If no images are being monitored:
-
Verify Docker socket access:
-
Check container discovery logs:
-
Ensure containers have the proper
diun.enable=true label
Image Update Triggers
Diun identifies image updates by:
- Tag Changes: When an image with a specific tag is updated
- New Tags: When configured to watch repositories for new tags
- 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: