DrydockDrydock
ConfigurationTriggers

Triggers

Triggers are responsible for performing actions when a new container version is found.

Triggers are responsible for performing actions when a new container version is found.

Triggers are enabled using environment variables.

DD_ACTION_{{ trigger_type }}_{{ trigger_name }}_{{ trigger_configuration_item }}=XXX
DD_NOTIFICATION_{{ trigger_type }}_{{ trigger_name }}_{{ trigger_configuration_item }}=XXX
Multiple triggers of the same type can be configured (for example multiple Smtp addresses). You just need to give them different names.

Environment variable prefixes

Three prefixes are supported for trigger configuration:

PrefixStatusExample
DD_ACTION_*CurrentDD_ACTION_SLACK_MYSLACK_URL=https://...
DD_NOTIFICATION_*CurrentDD_NOTIFICATION_SMTP_GMAIL_HOST=smtp.gmail.com
DD_TRIGGER_*Deprecated (removal in v1.7.0)DD_TRIGGER_SLACK_MYSLACK_URL=https://...

All three prefixes are interchangeable -- they configure the same triggers. Use whichever reads best for your use case: DD_ACTION_* for update-action triggers (Docker, Docker Compose) and DD_NOTIFICATION_* for messaging triggers (Slack, SMTP, Discord, etc.), or use either for any trigger type.

When the same trigger property is set under multiple prefixes, the merge priority is DD_NOTIFICATION_* > DD_ACTION_* > DD_TRIGGER_* (highest wins).

A built-in migration CLI can rewrite your config files from DD_TRIGGER_* to DD_ACTION_* automatically: drydock config migrate --source trigger. Use --dry-run to preview changes before applying.

Available triggers

Update actions:

  • Docker -- Update containers via the Docker Engine API
  • Docker Compose -- Update containers managed by Docker Compose

Messaging & notifications:

Common trigger configuration

All implemented triggers, in addition to their specific configuration, also support the following common configuration variables. The table uses the DD_TRIGGER_* prefix for brevity, but DD_ACTION_* and DD_NOTIFICATION_* work identically (see Environment variable prefixes above).

Env varRequiredDescriptionSupported valuesDefault value when missing
DD_TRIGGER_{trigger_type}_{trigger_name}_AUTOControls automatic execution. true — auto-execute for all watched containers. oninclude — auto-execute only for containers with an explicit dd.action.include or dd.notification.include label. false — manual only (from UI, API...)true, false, onincludeoninclude for action triggers (docker, dockercompose, command); true for notification triggers
DD_TRIGGER_{trigger_type}_{trigger_name}_BATCHTITLEThe template to use to render the title of the notification (batch mode)String template with placeholders ${count}${containers.length} updates available
DD_TRIGGER_{trigger_type}_{trigger_name}_MODETrigger for each container update, trigger once with all available updates as a list, or accumulate updates and send on a schedulesimple, batch, digestsimple
DD_TRIGGER_{trigger_type}_{trigger_name}_DIGESTCRONCron schedule for digest mode flush (only used when MODE=digest)Cron expression0 8 * * *
DD_TRIGGER_{trigger_type}_{trigger_name}_ONCERun trigger once (do not repeat previous results)true, falsetrue
DD_TRIGGER_{trigger_type}_{trigger_name}_ORDERTrigger execution order (lower runs first)Number100
DD_TRIGGER_{trigger_type}_{trigger_name}_SIMPLEBODYThe template to use to render the body of the notificationJS string template with vars containerContainer ${container.name} running with ${container.updateKind.kind} ${container.updateKind.localValue} can be updated to ${container.updateKind.kind} ${container.updateKind.remoteValue}${container.result && container.result.link ? "\\n" + container.result.link : ""}
DD_TRIGGER_{trigger_type}_{trigger_name}_SIMPLETITLEThe template to use to render the title of the notification (simple mode)JS string template with vars ${containers}New ${container.updateKind.kind} found for container ${container.name}
DD_TRIGGER_{trigger_type}_{trigger_name}_THRESHOLDThe threshold to reach to run the triggerall, major, major-only, minor, minor-only, patch, digest, and *-no-digest variants (major-no-digest, major-only-no-digest, minor-no-digest, minor-only-no-digest, patch-no-digest)all
DD_TRIGGER_{trigger_type}_{trigger_name}_RESOLVENOTIFICATIONSAuto-dismiss the notification after the container is successfully updatedtrue, falsefalse

Threshold reference

ThresholdFires on
allAny change (default)
majorMajor, minor, or patch semver change
major-onlyMajor only
minorAny semver change that is not major (minor, patch, prerelease)
minor-onlyMinor only
patchAny semver change that is not major or minor (patch, prerelease)
digestDigest changes only

Any threshold can be suffixed with -no-digest to exclude digest-only updates (e.g. major-no-digest, minor-only-no-digest). Updates with an unknown update kind are always filtered out regardless of the threshold setting.

Notes

  • RESOLVENOTIFICATIONS is currently implemented for Gotify (auto-deletes the notification message after a successful update). Other providers can be extended to support it.
  • Some messaging triggers (Slack, Telegram, Teams, Matrix, Mattermost, Rocket.Chat, Google Chat) also support DISABLETITLE (default false) to send only the body without a title line.
  • You can set DD_TRIGGER_{trigger_type}_THRESHOLD to define a default threshold for all triggers of the same type, e.g. DD_TRIGGER_NTFY_THRESHOLD=minor.
  • Triggers are executed by ascending ORDER; when two triggers have the same ORDER, they are sorted by trigger id.
  • Triggers sharing the same trigger name (e.g. docker.update and discord.update) can share THRESHOLD; if exactly one threshold value is defined among them, that value is used for the others unless they override it explicitly.
  • Setting ONCE=false with MODE=batch gives a report with all pending updates on every run.
  • MODE=digest accumulates update events in an in-memory buffer and flushes them as a single batch notification on the DIGESTCRON schedule. If the same container has multiple updates within the window, only the latest is included. Containers that are updated before the digest fires are automatically evicted from the buffer. Useful for daily email digests: DD_TRIGGER_SMTP_GMAIL_MODE=digest + DD_TRIGGER_SMTP_GMAIL_DIGESTCRON=0 8 * * *.

Notification Rules

Notification rules control which events fire which triggers. Each rule corresponds to an event type and has an enabled flag and an optional list of trigger IDs.

Rule IDDefault enabledDescription
update-availableYesA container has a newer version available
update-appliedYesA container was successfully updated
update-failedYesAn update failed or was rolled back
security-alertYesCritical/high vulnerability detected during pre-update scan
agent-disconnectNoA remote agent lost its connection

Dispatch behavior:

  • update-available -- for backward compatibility, when its trigger list is empty all triggers fire (existing behavior is preserved). Once you assign specific triggers, only those fire.
  • update-applied, update-failed, security-alert -- these require explicit trigger assignments. They are enabled by default but will not fire any trigger until you add trigger IDs to their rules.
  • agent-disconnect -- disabled by default. Enable it and assign triggers to receive disconnect alerts. This event always fires regardless of the threshold setting.

Rules are managed via GET /api/v1/notifications and PATCH /api/v1/notifications/:id (update enabled and/or triggers fields), or through the Notifications view in the UI.

Docker and Docker Compose triggers cannot be assigned to notification rules. These are update-action triggers (they perform container updates), not notification triggers. Only messaging/alerting triggers (Slack, SMTP, Discord, ntfy, etc.) can be assigned to rules.

Event Types

Beyond the classic update-available event, triggers can fire on additional events:

  • update-applied -- fires after a container is successfully updated by a Docker or Docker Compose trigger. Useful for audit or confirmation notifications.
  • update-failed -- fires when an update fails or is rolled back. Carries the container name and error message.
  • security-alert -- fires when the Update Bouncer detects critical or high vulnerabilities during a pre-update scan. Includes a vulnerability summary.
  • agent-disconnect -- fires when a remote agent loses its connection. This event skips threshold checks (always fires).
To receive notifications for these events, add the desired trigger IDs to the corresponding notification rule via the API or UI.

Template Variable Reference

Template strings use ${expression} placeholders. Drydock provides two sets of variables depending on the trigger mode.

Simple mode variables

VariableDescriptionExample value
containerThe full container object(object)
container.idContainer IDsha256:abc123...
container.nameContainer namemy-app
container.displayNameDisplay name (from dd.display.name label, defaults to name)My App
container.displayIconDisplay icon (from dd.display.icon label)mdi:docker
container.statusContainer runtime statusrunning
container.watcherWatcher namelocal
container.agentAgent name (when using distributed agents)remote-1
container.image.nameImage namelibrary/nginx
container.image.registry.nameRegistry provider namehub
container.image.registry.urlRegistry URLhttps://registry-1.docker.io
container.image.tag.valueCurrent image tag1.24.0
container.image.tag.semverWhether the tag is valid semvertrue
container.image.digest.valueCurrent image digestsha256:abc123...
container.image.digest.watchWhether digest watching is enabledtrue
container.image.architectureImage architectureamd64
container.image.osImage OSlinux
container.image.createdImage creation date2024-01-15T10:30:00Z
container.updateKind.kindUpdate type: tag, digest, or unknowntag
container.updateKind.localValueCurrent version (tag or digest)1.24.0
container.updateKind.remoteValueNew version (tag or digest)1.25.0
container.updateKind.semverDiffSemver diff level: major, minor, patch, prerelease, or unknownminor
container.result.tagNew tag value from the registry1.25.0
container.result.digestNew digest value from the registrysha256:def456...
container.result.createdCreation date of the new image2024-02-01T08:00:00Z
container.result.linkLink to the release (when a link template is configured)https://github.com/org/repo/releases/tag/v1.25.0
container.error.messageError message (when an error occurred)401 Unauthorized

Legacy aliases (deprecated)

These aliases resolve to a single container property and will be removed in v1.6.0. Use the container.* equivalents instead.

Legacy variableEquivalentDescription
idcontainer.idContainer ID
namecontainer.nameContainer name
watchercontainer.watcherWatcher name
kindcontainer.updateKind.kindUpdate type
semvercontainer.updateKind.semverDiffSemver diff level
localcontainer.updateKind.localValueCurrent version
remotecontainer.updateKind.remoteValueNew version
linkcontainer.result.linkRelease link

Batch mode variables

VariableDescriptionExample value
containersArray of container objects (each with the same properties as above)(array)
containers.lengthNumber of containers in the batch3

Legacy alias (deprecated)

Legacy variableEquivalentDescription
countcontainers.lengthNumber of containers in the batch

Expression syntax

Inside ${...} you can use:

  • Property paths -- container.updateKind.kind
  • Method calls -- local.substring(0, 15) (see allowed methods below)
  • Ternary -- container.result.link ? container.result.link : "no link"
  • Logical AND -- container.result && container.result.link
  • String concatenation -- "Version: " + container.updateKind.remoteValue
  • String and number literals -- "hello", 42

Allowed string methods: substring, slice, toLowerCase, toUpperCase, trim, trimStart, trimEnd, replace, split, indexOf, lastIndexOf, startsWith, endsWith, includes, charAt, padStart, padEnd, repeat, toString.

Examples

services:
  drydock:
    image: codeswhat/drydock
    ...
    environment:
      - DD_TRIGGER_SMTP_GMAIL_SIMPLETITLE=Container $${container.name} can be updated
      - DD_TRIGGER_SMTP_GMAIL_SIMPLEBODY=Container $${name} can be updated from $${local.substring(0, 15)} to $${remote.substring(0, 15)}
docker run \
  -e 'DD_TRIGGER_SMTP_GMAIL_SIMPLETITLE=Container ${container.name} can be updated' \
  -e 'DD_TRIGGER_SMTP_GMAIL_SIMPLEBODY=Container ${name} can be updated from ${local.substring(0, 15)} to ${remote.substring(0, 15)}'
  ...
  codeswhat/drydock

On this page