Skip to main content

Command

The command trigger executes a shell command or script whenever container updates are detected.


⚙️ Configuration Variables

WUD_TRIGGER_COMMAND_{trigger_name}_CMD
Requiredstring

The shell command or script path to execute

WUD_TRIGGER_COMMAND_{trigger_name}_SHELL
Optionalpathdefault: /bin/sh

Shell binary path to use for execution

Allowed values:Valid installed shell path (e.g. `/bin/sh`, `/bin/bash`)
WUD_TRIGGER_COMMAND_{trigger_name}_TIMEOUT
Optionalintegerdefault: 60000

Command execution timeout in milliseconds

Allowed values:Positive integer (`0` for no timeout)
info

This trigger also supports all common trigger configuration options (such as thresholds, scheduling, and batching).


🚀 Examples

Run an Inline Shell Command

services:
whatsupdocker:
image: getwud/wud
environment:
- WUD_TRIGGER_COMMAND_LOCAL_CMD=echo "$${display_name} can be updated to $${update_kind_remote_value}"

Run a Mounted Shell Script

services:
whatsupdocker:
image: getwud/wud
volumes:
- ./trigger.sh:/wud/trigger.sh:ro
environment:
- WUD_TRIGGER_COMMAND_LOCAL_CMD=/wud/trigger.sh
- WUD_TRIGGER_COMMAND_LOCAL_SHELL=/bin/bash

📦 Environment Variables Passed to Command

In Simple Mode (One execution per update)

The following environment variables are exported to the child process:

  • display_icon: Container display icon (e.g. mdi:docker)
  • display_name: Container display name (e.g. web-app)
  • id: Docker container ID
  • image_architecture: OS architecture (e.g. amd64, arm64)
  • image_created: Timestamp of image creation
  • image_digest_repo: Remote image digest SHA-256
  • image_digest_watch: Whether digest watching is active
  • image_id: Local Docker image ID
  • image_name: Image repository name (e.g. library/nginx)
  • image_os: Target operating system (e.g. linux)
  • image_registry_name: Registry identifier in WUD
  • image_registry_url: Base URL of the container registry
  • image_tag_semver: Whether tag follows semantic versioning
  • image_tag_value: Current running tag
  • name: Raw container name
  • result_tag: Candidate update tag
  • status: Current container status (e.g. running)
  • update_available: true
  • update_kind_kind: Update type (tag or digest)
  • update_kind_local_value: Current local version value
  • update_kind_remote_value: New remote version value
  • update_kind_semver_diff: Semver bump type (major, minor, patch)
  • watcher: Watcher identifier
  • container_json: Full serialized JSON representation of the container object

In Batch Mode (One execution for a batch of updates)

  • containers_json: Full serialized JSON array containing all updated container objects